summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChloe <25727384+ogniK5377@users.noreply.github.com>2020-12-09 12:47:03 +0100
committerGitHub <noreply@github.com>2020-12-09 12:47:03 +0100
commit6d6115475b4edccdf1bb4e96ecc3d3b1be319e76 (patch)
treec68dd1b8c2873c623a5dfde1eb68b53d440d2669
parentMerge pull request #5174 from ReinUsesLisp/fs-fix (diff)
parentvfs_real: Fix CreateFile for files without a file extension (diff)
downloadyuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar
yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.gz
yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.bz2
yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.lz
yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.xz
yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.zst
yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.zip
-rw-r--r--src/core/file_sys/vfs_real.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index 488687ba9..3b70f7755 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -94,9 +94,13 @@ VirtualFile RealVfsFilesystem::OpenFile(std::string_view path_, Mode perms) {
VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) {
const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
- const auto path_fwd = FS::SanitizePath(path, FS::DirectorySeparator::ForwardSlash);
+ const auto parent_path = FS::GetParentPath(path);
+
if (!FS::Exists(path)) {
- FS::CreateFullPath(path_fwd);
+ if (!FS::CreateDirs(parent_path)) {
+ return nullptr;
+ }
+
if (!FS::CreateEmptyFile(path)) {
return nullptr;
}