From 63dcac833eb69e99e8afdecf96e465b24f5e01cd Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Sat, 30 Mar 2019 15:57:06 +0100 Subject: [PATCH] Try to change all back slashes to forward slashes. --- Core/Config.cpp | 7 +++++-- Core/PSPLoaders.cpp | 2 +- UI/MainScreen.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index a4ea72eb6a..676a588437 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1268,9 +1268,12 @@ void Config::AddRecent(const std::string &file) { // We'll add it back below. This makes sure it's at the front, and only once. RemoveRecent(file); - const std::string filename = File::ResolvePath(file); - recentIsos.insert(recentIsos.begin(), filename); + std::string filename2 = filename; +#ifdef _WIN32 + filename2 = ReplaceAll(filename, "\\", "/"); +#endif + recentIsos.insert(recentIsos.begin(), filename2); if ((int)recentIsos.size() > iMaxRecent) recentIsos.resize(iMaxRecent); } diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index 697a1240a9..1cb8da8613 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -321,7 +321,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { #ifdef _WIN32 // Turn the slashes back to the Windows way. - path = ReplaceAll(path, "/", "\\"); + //path = ReplaceAll(path, "/", "\\"); #endif if (!PSP_CoreParameter().mountRoot.empty()) { diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index ae7482341b..aae3f1656b 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -76,9 +76,9 @@ static bool IsTempPath(const std::string &str) { const auto testPath = [&](std::string temp) { #ifdef _WIN32 - temp = ReplaceAll(temp, "/", "\\"); - if (!temp.empty() && temp[temp.size() - 1] != '\\') - temp += "\\"; + temp = ReplaceAll(temp, "\\", "/"); + if (!temp.empty() && temp[temp.size() - 1] != '/') + temp += "/"; #else if (!temp.empty() && temp[temp.size() - 1] != '/') temp += "/"; @@ -94,7 +94,7 @@ static bool IsTempPath(const std::string &str) { #ifdef _WIN32 // Normalize slashes. - item = ReplaceAll(str, "/", "\\"); + item = ReplaceAll(str, "\\", "/"); wchar_t tempPath[MAX_PATH]; GetTempPath(MAX_PATH, tempPath);