Ignore leading spaces on absolute paths.

Weird but true.  Not sure if it will help any game.
This commit is contained in:
Unknown W. Brackets
2013-10-08 23:55:51 -07:00
parent 73d5c42596
commit 132577a050

View File

@@ -177,9 +177,21 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat
lock_guard guard(lock);
std::string realpath;
std::string inpath = _inpath;
// "ms0:/file.txt" is equivalent to " ms0:/file.txt". Yes, really.
if (inpath.find(':') != inpath.npos) {
size_t offset = 0;
while (inpath[offset] == ' ') {
offset++;
}
if (offset > 0) {
inpath = inpath.substr(offset);
}
}
// 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 (strncasecmp(inpath.c_str(), "host0:", strlen("host0:")) == 0) {
INFO_LOG(FILESYS, "Host0 path detected, stripping: %s", inpath.c_str());
inpath = inpath.substr(strlen("host0:"));