summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Morph2020-07-15 12:16:31 -0400
committerGravatar Morph2020-07-16 00:15:27 -0400
commit2079bb4090b97b87faf69b3a32f8c115de61002e (patch)
treebba0fddafbd717cf4b89c0e76783e5dd0be4e42f /src
parentMerge pull request #4328 from lioncash/unused-var3 (diff)
downloadyuzu-2079bb4090b97b87faf69b3a32f8c115de61002e.tar.gz
yuzu-2079bb4090b97b87faf69b3a32f8c115de61002e.tar.xz
yuzu-2079bb4090b97b87faf69b3a32f8c115de61002e.zip
filesystem: Create subdirectories prior to creating a file
If subdirectories exist in the given path parameter and don't exist in the real filesystem create them prior to creating the files within. This fixes the softlocks upon save creation in The Legend of Zelda: Breath of the Wild
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index cadc03805..3020101a1 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -55,6 +55,9 @@ std::string VfsDirectoryServiceWrapper::GetName() const {
55ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size) const { 55ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size) const {
56 std::string path(FileUtil::SanitizePath(path_)); 56 std::string path(FileUtil::SanitizePath(path_));
57 auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path)); 57 auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path));
58 if (dir == nullptr) {
59 dir = backing->CreateSubdirectory(FileUtil::GetParentPath(path));
60 }
58 auto file = dir->CreateFile(FileUtil::GetFilename(path)); 61 auto file = dir->CreateFile(FileUtil::GetFilename(path));
59 if (file == nullptr) { 62 if (file == nullptr) {
60 // TODO(DarkLordZach): Find a better error code for this 63 // TODO(DarkLordZach): Find a better error code for this