Windows: convert to internal separators when finding files.

This commit is contained in:
Kimmo Varis 2010-07-26 22:13:34 +03:00
parent 60cf37d1ef
commit 7b8cb17a44
1 changed files with 9 additions and 5 deletions

View File

@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "filelister.h"
#include "filelister_win32.h"
#include <sstream>
#include <vector>
#include <cstring>
@ -25,6 +23,10 @@
#include <cctype>
#include <algorithm>
#include "filelister.h"
#include "filelister_win32.h"
#include "path.h"
#if defined(_WIN32)
#include <windows.h>
#ifndef __BORLANDC__
@ -102,8 +104,7 @@ void FileListerWin32::recursiveAddFiles(std::vector<std::string> &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<std::string> &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)
{