1
0
This commit is contained in:
Scott E. Graves
2017-03-28 01:10:58 -05:00
parent ca6390fff3
commit 0055169dca

View File

@@ -9,10 +9,11 @@ SString FilePath::FinalizePath(const SString& path)
{ {
#ifdef _WIN32 #ifdef _WIN32
std::wregex r(L"/+"); std::wregex r(L"/+");
return std::regex_replace(path.str(), r, L"\\"); SString str = std::regex_replace(path.str(), r, L"\\");
std::wregex r2(L"\\\\+");
return std::regex_replace(str.str(), r2, L"\\\\");
#else #else
std::wregex r(L"\\+"); a
return std::regex_replace(path.str(), r, L"/");
#endif #endif
} }
@@ -92,13 +93,13 @@ const SString FilePath::DirSep = "/";
FilePath& FilePath::Append(const FilePath& filePath) FilePath& FilePath::Append(const FilePath& filePath)
{ {
_path += (DirSep + filePath); _path = FinalizePath(_path + DirSep + filePath);
return *this; return *this;
} }
FilePath& FilePath::Append(const SString& path) FilePath& FilePath::Append(const SString& path)
{ {
_path += (DirSep + FinalizePath(path)); _path = FinalizePath(_path + DirSep + path);
return *this; return *this;
} }