summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-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
60 60
61ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { 61ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const {
62 std::string path(FileUtil::SanitizePath(path_)); 62 std::string path(FileUtil::SanitizePath(path_));
63 auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path));
64 if (path.empty()) { 63 if (path.empty()) {
65 // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but... 64 // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but...
66 return RESULT_SUCCESS; 65 return RESULT_SUCCESS;
67 } 66 }
68 if (dir->GetFile(FileUtil::GetFilename(path)) == nullptr) 67
68 auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path));
69 if (dir->GetFile(FileUtil::GetFilename(path)) == nullptr) {
69 return FileSys::ERROR_PATH_NOT_FOUND; 70 return FileSys::ERROR_PATH_NOT_FOUND;
71 }
70 if (!dir->DeleteFile(FileUtil::GetFilename(path))) { 72 if (!dir->DeleteFile(FileUtil::GetFilename(path))) {
71 // TODO(DarkLordZach): Find a better error code for this 73 // TODO(DarkLordZach): Find a better error code for this
72 return ResultCode(-1); 74 return ResultCode(-1);
73 } 75 }
76
74 return RESULT_SUCCESS; 77 return RESULT_SUCCESS;
75} 78}
76 79