From 7b8cb17a44f649179f63cbd05d72d61c7a570348 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 26 Jul 2010 22:13:34 +0300 Subject: [PATCH] Windows: convert to internal separators when finding files. --- lib/filelister_win32.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/filelister_win32.cpp b/lib/filelister_win32.cpp index 8c4a997dd..58a55e9af 100644 --- a/lib/filelister_win32.cpp +++ b/lib/filelister_win32.cpp @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -#include "filelister.h" -#include "filelister_win32.h" #include #include #include @@ -25,6 +23,10 @@ #include #include +#include "filelister.h" +#include "filelister_win32.h" +#include "path.h" + #if defined(_WIN32) #include #ifndef __BORLANDC__ @@ -102,8 +104,7 @@ void FileListerWin32::recursiveAddFiles(std::vector &filenames, con // It always has a trailing backslash available for concatenation. std::ostringstream bdir, oss; - std::string cleanedPath = path; - std::replace(cleanedPath.begin(), cleanedPath.end(), '/', '\\'); + std::string cleanedPath = Path::toNativeSeparators(path); oss << cleanedPath; @@ -160,7 +161,10 @@ void FileListerWin32::recursiveAddFiles(std::vector &filenames, con // If recursive is not used, accept all files given by user if (!recursive || FileLister::acceptFile(ansiFfd)) - filenames.push_back(fname.str()); + { + const std::string nativename = Path::fromNativeSeparators(fname.str()); + filenames.push_back(nativename); + } } else if (recursive) {