From 6327c6e629dd21dbccd73fdab811e43966965aba Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 9 Jan 2013 00:57:44 -0800 Subject: [PATCH] Make filesystem prefix matching case fold. Even Ms0:/, disC0:/ and HoSt0:/ etc. work. --- Core/FileSystems/MetaFileSystem.cpp | 4 ++-- Core/PSPLoaders.cpp | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Core/FileSystems/MetaFileSystem.cpp b/Core/FileSystems/MetaFileSystem.cpp index ad144396d8..fde8036b24 100644 --- a/Core/FileSystems/MetaFileSystem.cpp +++ b/Core/FileSystems/MetaFileSystem.cpp @@ -169,7 +169,7 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat // Special handling: host0:command.txt (as seen in Super Monkey Ball Adventures, for example) // appears to mean the current directory on the UMD. Let's just assume the current directory. std::string inpath = _inpath; - if (inpath.substr(0, 6) == "host0:") { + if (strncasecmp(inpath.c_str(), "host0:", 5) == 0) { INFO_LOG(HLE, "Host0 path detected, stripping: %s", inpath.c_str()); inpath = inpath.substr(6); } @@ -179,7 +179,7 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat for (size_t i = 0; i < fileSystems.size(); i++) { size_t prefLen = fileSystems[i].prefix.size(); - if (fileSystems[i].prefix == realpath.substr(0, prefLen)) + if (strncasecmp(fileSystems[i].prefix.c_str(), realpath.c_str(), prefLen) == 0) { outpath = realpath.substr(prefLen); *system = fileSystems[i].system; diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index db8233343b..0e1c599a68 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -64,10 +64,6 @@ bool Load_PSP_ISO(const char *filename, std::string *error_string) pspFileSystem.Mount("umd1:", umd2); pspFileSystem.Mount("disc0:", umd2); pspFileSystem.Mount("umd:", umd2); - pspFileSystem.Mount("UMD0:", umd2); - pspFileSystem.Mount("UMD1:", umd2); - pspFileSystem.Mount("DISC0:", umd2); - pspFileSystem.Mount("UMD:", umd2); std::string sfoPath("disc0:/PSP_GAME/PARAM.SFO"); PSPFileInfo fileInfo = pspFileSystem.GetFileInfo(sfoPath.c_str()); @@ -124,9 +120,6 @@ bool Load_PSP_ELF_PBP(const char *filename, std::string *error_string) pspFileSystem.Mount("umd1:", umd2); pspFileSystem.Mount("disc0:", umd2); pspFileSystem.Mount("umd:", umd2); - pspFileSystem.Mount("UMD1:", umd2); - pspFileSystem.Mount("DISC0:", umd2); - pspFileSystem.Mount("UMD:", umd2); } std::string full_path = filename;