Loaders: Look for PSP/GAME/ not /PSP/GAME/.

Because upcoming Path changes will affect path string comparisons.
This commit is contained in:
Henrik Rydgård authored and Unknown W. Brackets committed 2021-05-09 17:50:59 -07:00
1 parent ac68dac029
commit cc3868db97
3 files changed
+12 -6

No files matched your search

+8 -2
View File
@@ -374,11 +374,17 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) {
std::string full_path = fileLoader->GetPath();
std::string path, file, extension;
SplitPath(ReplaceAll(full_path, "\\", "/"), &path, &file, &extension);
if (!path.empty() && path.back() == '/')
path.resize(path.size() - 1);
#ifdef _WIN32
if (!path.empty() && path.back() == '\\')
path.resize(path.size() - 1);
#endif
size_t pos = path.find("/PSP/GAME/");
size_t pos = path.find("PSP/GAME/");
std::string ms_path;
if (pos != std::string::npos) {
ms_path = "ms0:" + path.substr(pos);
ms_path = "ms0:/" + path.substr(pos) + "/";
} else {
// This is wrong, but it's better than not having a working directory at all.
// Note that umd0:/ is actually the writable containing directory, in this case.