summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-10-20 01:04:01 +0200
committerGitHub <noreply@github.com>2020-10-20 01:04:01 +0200
commite7a26ecec591c916ef0c4941e07be9723fb3b4fa (patch)
tree5fa03ab1d0aa1bef781c2584f9ef5f833aa41fdd
parentMerge pull request #4204 from ReinUsesLisp/vulkan-1.0 (diff)
parentfilesystem: Fix CreateDirectory and DeleteFile (diff)
downloadyuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar
yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.gz
yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.bz2
yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.lz
yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.xz
yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.zst
yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 54a5fb84b..3cdef4888 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -79,7 +79,7 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons
}
auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
- if (dir->GetFile(Common::FS::GetFilename(path)) == nullptr) {
+ if (dir == nullptr || dir->GetFile(Common::FS::GetFilename(path)) == nullptr) {
return FileSys::ERROR_PATH_NOT_FOUND;
}
if (!dir->DeleteFile(Common::FS::GetFilename(path))) {
@@ -93,8 +93,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons
ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const {
std::string path(Common::FS::SanitizePath(path_));
auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
- if (dir == nullptr && Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty())
+ if (dir == nullptr || Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty()) {
dir = backing;
+ }
auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path));
if (new_dir == nullptr) {
// TODO(DarkLordZach): Find a better error code for this