From 68718361a7cf77407b8b781c20523a9b94866a23 Mon Sep 17 00:00:00 2001 From: Eladash Date: Tue, 19 Jul 2022 07:00:53 +0300 Subject: [PATCH] Allow non-existing paths in vfs::retrieve --- rpcs3/Emu/VFS.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index 12c0211144..30dffd8ec9 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -364,14 +364,7 @@ std::string vfs::retrieve(std::string_view path, const vfs_directory* node, std: if (!node) { - if (path.starts_with(".")) - { - return {}; - } - - const std::string rpath = Emu.GetCallbacks().resolve_path(path); - - if (rpath.empty()) + if (path.starts_with(".") || path.empty()) { return {}; } @@ -380,6 +373,20 @@ std::string vfs::retrieve(std::string_view path, const vfs_directory* node, std: std::vector mount_path_empty; + if (std::string res = vfs::retrieve(path, &table.root, &mount_path_empty); !res.empty()) + { + return res; + } + + mount_path_empty.clear(); + + const std::string rpath = Emu.GetCallbacks().resolve_path(path); + + if (rpath.empty()) + { + return {}; + } + return vfs::retrieve(rpath, &table.root, &mount_path_empty); }