diff options
| author | 2020-10-19 16:04:01 -0700 | |
|---|---|---|
| committer | 2020-10-19 16:04:01 -0700 | |
| commit | e7a26ecec591c916ef0c4941e07be9723fb3b4fa (patch) | |
| tree | 5fa03ab1d0aa1bef781c2584f9ef5f833aa41fdd /src | |
| parent | Merge pull request #4204 from ReinUsesLisp/vulkan-1.0 (diff) | |
| parent | filesystem: Fix CreateDirectory and DeleteFile (diff) | |
| download | yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.gz yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.tar.xz yuzu-e7a26ecec591c916ef0c4941e07be9723fb3b4fa.zip | |
Merge pull request #4785 from Morph1984/fs-hades
filesystem: Fix CreateDirectory and DeleteFile
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 5 |
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 | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | 81 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); |
| 82 | if (dir->GetFile(Common::FS::GetFilename(path)) == nullptr) { | 82 | if (dir == nullptr || dir->GetFile(Common::FS::GetFilename(path)) == nullptr) { |
| 83 | return FileSys::ERROR_PATH_NOT_FOUND; | 83 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 84 | } | 84 | } |
| 85 | if (!dir->DeleteFile(Common::FS::GetFilename(path))) { | 85 | if (!dir->DeleteFile(Common::FS::GetFilename(path))) { |
| @@ -93,8 +93,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons | |||
| 93 | ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { | 93 | ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { |
| 94 | std::string path(Common::FS::SanitizePath(path_)); | 94 | std::string path(Common::FS::SanitizePath(path_)); |
| 95 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | 95 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); |
| 96 | if (dir == nullptr && Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty()) | 96 | if (dir == nullptr || Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty()) { |
| 97 | dir = backing; | 97 | dir = backing; |
| 98 | } | ||
| 98 | auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path)); | 99 | auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path)); |
| 99 | if (new_dir == nullptr) { | 100 | if (new_dir == nullptr) { |
| 100 | // TODO(DarkLordZach): Find a better error code for this | 101 | // TODO(DarkLordZach): Find a better error code for this |