aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/disk_filesystem.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-07-14 10:57:22 -0500
committerSubv <subv2112@gmail.com>2018-07-14 10:57:22 -0500
commitd4a639a08eb91ca739e43c9f98195cc1be5dc067 (patch)
tree302cc30d0a66003a072d990e0670e79a1408ebda /src/core/file_sys/disk_filesystem.cpp
parentbe34ff65f1ee453fda119226a984ebc2f8905641 (diff)
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.
Diffstat (limited to 'src/core/file_sys/disk_filesystem.cpp')
-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 8c6f15bb5c..d248c2df45 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::
}
ResultCode Disk_FileSystem::DeleteFile(const std::string& path) const {
- if (!FileUtil::Exists(path)) {
+ std::string full_path = base_directory + path;
+
+ if (!FileUtil::Exists(full_path)) {
return ERROR_PATH_NOT_FOUND;
}
- FileUtil::Delete(path);
+ FileUtil::Delete(full_path);
return RESULT_SUCCESS;
}