diff options
| author | 2020-12-09 22:47:03 +1100 | |
|---|---|---|
| committer | 2020-12-09 22:47:03 +1100 | |
| commit | 6d6115475b4edccdf1bb4e96ecc3d3b1be319e76 (patch) | |
| tree | c68dd1b8c2873c623a5dfde1eb68b53d440d2669 /src | |
| parent | Merge pull request #5174 from ReinUsesLisp/fs-fix (diff) | |
| parent | vfs_real: Fix CreateFile for files without a file extension (diff) | |
| download | yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.gz yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.tar.xz yuzu-6d6115475b4edccdf1bb4e96ecc3d3b1be319e76.zip | |
Merge pull request #5176 from Morph1984/fix-createfile
vfs_real: Fix CreateFile for files without a file extension
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/vfs_real.cpp | 8 |
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) { | |||
| 94 | 94 | ||
| 95 | VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) { | 95 | VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) { |
| 96 | const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); | 96 | const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault); |
| 97 | const auto path_fwd = FS::SanitizePath(path, FS::DirectorySeparator::ForwardSlash); | 97 | const auto parent_path = FS::GetParentPath(path); |
| 98 | |||
| 98 | if (!FS::Exists(path)) { | 99 | if (!FS::Exists(path)) { |
| 99 | FS::CreateFullPath(path_fwd); | 100 | if (!FS::CreateDirs(parent_path)) { |
| 101 | return nullptr; | ||
| 102 | } | ||
| 103 | |||
| 100 | if (!FS::CreateEmptyFile(path)) { | 104 | if (!FS::CreateEmptyFile(path)) { |
| 101 | return nullptr; | 105 | return nullptr; |
| 102 | } | 106 | } |