Explorar o código

Merge pull request #720 from Subv/getentrytype_root

Filesystem: Return EntryType::Directory for the root directory.
Sebastian Valle %!s(int64=8) %!d(string=hai) anos
pai
achega
78dd1cd441
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/core/hle/service/filesystem/filesystem.cpp

+ 4 - 0
src/core/hle/service/filesystem/filesystem.cpp

@@ -193,6 +193,10 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType(
     if (dir == nullptr)
         return FileSys::ERROR_PATH_NOT_FOUND;
     auto filename = FileUtil::GetFilename(path);
+    // TODO(Subv): Some games use the '/' path, find out what this means.
+    if (filename.empty())
+        return MakeResult(FileSys::EntryType::Directory);
+
     if (dir->GetFile(filename) != nullptr)
         return MakeResult(FileSys::EntryType::File);
     if (dir->GetSubdirectory(filename) != nullptr)