VERY experimental Nintendo Switch 2 emulator
C++
filesystem: Move dir retrieval after path checking in DeleteFile()
Lioncash92e7a2f7ff7f
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cppindex 881c39e316..a4426af968 100644--- a/src/core/hle/service/filesystem/filesystem.cpp+++ b/src/core/hle/service/filesystem/filesystem.cpp@@ -60,17 +60,20 @@ ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const {std::string path(FileUtil::SanitizePath(path_));- auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path));if (path.empty()) {// TODO(DarkLordZach): Why do games call this and what should it do? Works as is but...return RESULT_SUCCESS;}- if (dir->GetFile(FileUtil::GetFilename(path)) == nullptr)++ auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path));+ if (dir->GetFile(FileUtil::GetFilename(path)) == nullptr) {return FileSys::ERROR_PATH_NOT_FOUND;+ }if (!dir->DeleteFile(FileUtil::GetFilename(path))) {// TODO(DarkLordZach): Find a better error code for thisreturn ResultCode(-1);}+return RESULT_SUCCESS;}