From 61a642b1ccd8afc9bffc50ef1ed934f1706b6ce8 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 27 Sep 2007 20:39:06 +0000 Subject: fixed savepath files listing under win32 svn-id: r29113 --- backends/fs/windows/windows-fs.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'backends/fs') 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; } -- cgit v1.2.3