summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-09-02 16:43:09 +0200
committerGitHub <noreply@github.com>2018-09-02 16:43:09 +0200
commit7a439630bb316618d2438001568887ace029b975 (patch)
treeaffda23e8735d1cd56f09a151c7c93d1d2f824a9
parentMerge pull request #1196 from FearlessTobi/ccache-consistency (diff)
parentfilesystem: Move dir retrieval after path checking in DeleteFile() (diff)
downloadyuzu-7a439630bb316618d2438001568887ace029b975.tar
yuzu-7a439630bb316618d2438001568887ace029b975.tar.gz
yuzu-7a439630bb316618d2438001568887ace029b975.tar.bz2
yuzu-7a439630bb316618d2438001568887ace029b975.tar.lz
yuzu-7a439630bb316618d2438001568887ace029b975.tar.xz
yuzu-7a439630bb316618d2438001568887ace029b975.tar.zst
yuzu-7a439630bb316618d2438001568887ace029b975.zip
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 881c39e31..a4426af96 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_, u64
ResultCode 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 this
return ResultCode(-1);
}
+
return RESULT_SUCCESS;
}