summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Subv2018-07-14 10:57:22 -0500
committerGravatar Subv2018-07-14 10:57:22 -0500
commit7e5e4f8d7a8ca22e3217d8edf12e47dd7b2273fe (patch)
tree302cc30d0a66003a072d990e0670e79a1408ebda
parentMerge pull request #660 from Subv/depth_write (diff)
downloadyuzu-7e5e4f8d7a8ca22e3217d8edf12e47dd7b2273fe.tar.gz
yuzu-7e5e4f8d7a8ca22e3217d8edf12e47dd7b2273fe.tar.xz
yuzu-7e5e4f8d7a8ca22e3217d8edf12e47dd7b2273fe.zip
FileSys: Append the requested path to the filesystem base path in DeleteFile.
We were trying to delete things in the current directory instead of the actual filesystem directory. This may fix some savedata issues in some games.
-rw-r--r--src/core/file_sys/disk_filesystem.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/file_sys/disk_filesystem.cpp b/src/core/file_sys/disk_filesystem.cpp
index 8c6f15bb5..d248c2df4 100644
--- a/src/core/file_sys/disk_filesystem.cpp
+++ b/src/core/file_sys/disk_filesystem.cpp
@@ -58,11 +58,13 @@ ResultVal<std::unique_ptr<StorageBackend>> Disk_FileSystem::OpenFile(const std::
58} 58}
59 59
60ResultCode Disk_FileSystem::DeleteFile(const std::string& path) const { 60ResultCode Disk_FileSystem::DeleteFile(const std::string& path) const {
61 if (!FileUtil::Exists(path)) { 61 std::string full_path = base_directory + path;
62
63 if (!FileUtil::Exists(full_path)) {
62 return ERROR_PATH_NOT_FOUND; 64 return ERROR_PATH_NOT_FOUND;
63 } 65 }
64 66
65 FileUtil::Delete(path); 67 FileUtil::Delete(full_path);
66 68
67 return RESULT_SUCCESS; 69 return RESULT_SUCCESS;
68} 70}