More elegant way of solving #5839 (d_private in sceIoDread)

We flag filesystems as being FAT32 instead of checking for "ms0:".
This commit is contained in:
Henrik Rydgard
2014-04-13 23:22:17 +02:00
parent ee4c464305
commit a53ecd7da3
8 changed files with 58 additions and 13 deletions
+11
View File
@@ -255,6 +255,10 @@ std::string MetaFileSystem::NormalizePrefix(std::string prefix) const {
if (startsWith(prefix, "host"))
prefix = "host0:";
// Should we simply make this case insensitive?
if (prefix == "DISC0:")
prefix = "disc0:";
return prefix;
}
@@ -284,6 +288,13 @@ void MetaFileSystem::Remount(IFileSystem *oldSystem, IFileSystem *newSystem) {
}
}
IFileSystem *MetaFileSystem::GetSystemFromFilename(const std::string &filename) {
size_t prefixPos = filename.find(':');
if (prefixPos == filename.npos)
return 0;
return GetSystem(filename.substr(0, prefixPos + 1));
}
IFileSystem *MetaFileSystem::GetSystem(const std::string &prefix) {
for (auto it = fileSystems.begin(); it != fileSystems.end(); ++it) {
if (it->prefix == NormalizePrefix(prefix))