diff options
author | BreadFish64 <breadfish64@users.noreply.github.com> | 2023-12-06 05:17:19 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-12-06 05:17:19 +0100 |
commit | d5de9402ee22eea985d6842baafd8922e15d3784 (patch) | |
tree | f302a3a87aad12213c36ef00cd28c86e3e27ba61 /src/core/file_sys/vfs_real.cpp | |
parent | Merge pull request #12271 from liamwhite/pretext-fix (diff) | |
download | yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.gz yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.bz2 yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.lz yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.xz yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.tar.zst yuzu-d5de9402ee22eea985d6842baafd8922e15d3784.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/vfs_real.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index 1c706e4d8..cd9b79786 100644 --- a/src/core/file_sys/vfs_real.cpp +++ b/src/core/file_sys/vfs_real.cpp @@ -268,7 +268,7 @@ void RealVfsFilesystem::RemoveReferenceFromListLocked(FileReference& reference) RealVfsFile::RealVfsFile(RealVfsFilesystem& base_, std::unique_ptr<FileReference> reference_, const std::string& path_, Mode perms_, std::optional<u64> size_) : base(base_), reference(std::move(reference_)), path(path_), - parent_path(FS::GetParentPath(path_)), path_components(FS::SplitPathComponents(path_)), + parent_path(FS::GetParentPath(path_)), path_components(FS::SplitPathComponentsCopy(path_)), size(size_), perms(perms_) {} RealVfsFile::~RealVfsFile() { @@ -276,7 +276,7 @@ RealVfsFile::~RealVfsFile() { } std::string RealVfsFile::GetName() const { - return path_components.back(); + return path_components.empty() ? "" : std::string(path_components.back()); } std::size_t RealVfsFile::GetSize() const { @@ -375,7 +375,7 @@ std::vector<VirtualDir> RealVfsDirectory::IterateEntries<RealVfsDirectory, VfsDi RealVfsDirectory::RealVfsDirectory(RealVfsFilesystem& base_, const std::string& path_, Mode perms_) : base(base_), path(FS::RemoveTrailingSlash(path_)), parent_path(FS::GetParentPath(path)), - path_components(FS::SplitPathComponents(path)), perms(perms_) { + path_components(FS::SplitPathComponentsCopy(path)), perms(perms_) { if (!FS::Exists(path) && True(perms & Mode::Write)) { void(FS::CreateDirs(path)); } @@ -464,7 +464,7 @@ bool RealVfsDirectory::IsReadable() const { } std::string RealVfsDirectory::GetName() const { - return path_components.back(); + return path_components.empty() ? "" : std::string(path_components.back()); } VirtualDir RealVfsDirectory::GetParentDirectory() const { |