aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorGregory Montoir2007-09-27 20:39:06 +0000
committerGregory Montoir2007-09-27 20:39:06 +0000
commit61a642b1ccd8afc9bffc50ef1ed934f1706b6ce8 (patch)
treea68da99f5907e314d7819fe7b17e5b67250a7b00 /backends/fs
parentd8831b44da24c16eef5fcc368d8d54953f0c60b5 (diff)
downloadscummvm-rg350-61a642b1ccd8afc9bffc50ef1ed934f1706b6ce8.tar.gz
scummvm-rg350-61a642b1ccd8afc9bffc50ef1ed934f1706b6ce8.tar.bz2
scummvm-rg350-61a642b1ccd8afc9bffc50ef1ed934f1706b6ce8.zip
fixed savepath files listing under win32
svn-id: r29113
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;
}