aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/windows/windows-fs.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index b2c3bc64fb..e048980ba1 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -216,12 +216,6 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool current
if (currentDir) {
char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
-
- // Add a trailing slash, if necessary.
- if (path[0] != 0) {
- if (path[strlen(path) - 1] != '\\')
- strcat(path, "\\");
- }
_path = path;
}
else {
@@ -240,6 +234,10 @@ WindowsFilesystemNode::WindowsFilesystemNode(const String &p, const bool current
} else {
_isDirectory = ((fileAttribs & FILE_ATTRIBUTE_DIRECTORY) != 0);
_isValid = true;
+ // Add a trailing slash, if necessary.
+ if (_path.lastChar() != '\\') {
+ _path += '\\';
+ }
}
_isPseudoRoot = false;
}