From 0055169dcadf825a890cd4ce9ae60d6dbf3a61bf Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 28 Mar 2017 01:10:58 -0500 Subject: [PATCH] Fix shit --- src/siadrive_api/filepath.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/siadrive_api/filepath.cpp b/src/siadrive_api/filepath.cpp index 6562983..20bcab0 100644 --- a/src/siadrive_api/filepath.cpp +++ b/src/siadrive_api/filepath.cpp @@ -9,10 +9,11 @@ SString FilePath::FinalizePath(const SString& path) { #ifdef _WIN32 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 - std::wregex r(L"\\+"); - return std::regex_replace(path.str(), r, L"/"); + a #endif } @@ -92,13 +93,13 @@ const SString FilePath::DirSep = "/"; FilePath& FilePath::Append(const FilePath& filePath) { - _path += (DirSep + filePath); + _path = FinalizePath(_path + DirSep + filePath); return *this; } FilePath& FilePath::Append(const SString& path) { - _path += (DirSep + FinalizePath(path)); + _path = FinalizePath(_path + DirSep + path); return *this; }