From 014846cf318aacb62af9ea6bf29c692d068ea708 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 23 Feb 2021 12:08:22 +0300 Subject: [PATCH] cellSaveData: fix minor issues --- Utilities/File.h | 2 +- rpcs3/Emu/Cell/Modules/cellSaveData.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Utilities/File.h b/Utilities/File.h index 0a23eb03e2..865f5117c3 100644 --- a/Utilities/File.h +++ b/Utilities/File.h @@ -607,7 +607,7 @@ namespace fs { fs::file file; - // This is meant to modify files atomically, overwriting is likely + // This is meant to modify files atomically, overwriting is likely bool commit(bool overwrite = true); pending_file(const std::string& path); diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp index 1a873e5756..7a7d757cdc 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.cpp @@ -1530,6 +1530,12 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { // Read file into a vector and make a memory file entry.name = vfs::unescape(entry.name); + + if (entry.name == ".") + { + continue; + } + all_times.emplace(entry.name, std::make_pair(entry.atime, entry.mtime)); all_files.emplace(std::move(entry.name), fs::make_stream(fs::file(dir_path + entry.name).to_vector())); } @@ -1910,7 +1916,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v { if (auto file = pair.second.release()) { - auto fvec = static_cast>&>(*file); + auto&& fvec = static_cast>&>(*file); ensure(fs::write_file(new_path + vfs::escape(pair.first), fs::rewrite, fvec.obj)); } }