Windows: convert to internal separators when finding files.
This commit is contained in:
parent
60cf37d1ef
commit
7b8cb17a44
|
@ -16,8 +16,6 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "filelister.h"
|
|
||||||
#include "filelister_win32.h"
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -25,6 +23,10 @@
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "filelister.h"
|
||||||
|
#include "filelister_win32.h"
|
||||||
|
#include "path.h"
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#ifndef __BORLANDC__
|
#ifndef __BORLANDC__
|
||||||
|
@ -102,8 +104,7 @@ void FileListerWin32::recursiveAddFiles(std::vector<std::string> &filenames, con
|
||||||
// It always has a trailing backslash available for concatenation.
|
// It always has a trailing backslash available for concatenation.
|
||||||
std::ostringstream bdir, oss;
|
std::ostringstream bdir, oss;
|
||||||
|
|
||||||
std::string cleanedPath = path;
|
std::string cleanedPath = Path::toNativeSeparators(path);
|
||||||
std::replace(cleanedPath.begin(), cleanedPath.end(), '/', '\\');
|
|
||||||
|
|
||||||
oss << cleanedPath;
|
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 is not used, accept all files given by user
|
||||||
if (!recursive || FileLister::acceptFile(ansiFfd))
|
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)
|
else if (recursive)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue