Make filesystem prefix matching case fold.

Even Ms0:/, disC0:/ and HoSt0:/ etc. work.
This commit is contained in:
Unknown W. Brackets 2013-01-09 00:57:44 -08:00
parent 3e3e9b761f
commit 6327c6e629
2 changed files with 2 additions and 9 deletions

View file

@ -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;

View file

@ -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;