From 59090f6d268c808599d423bf72e34d734040dc57 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 19 Sep 2018 14:15:38 +0300 Subject: [PATCH] VFS: fix /host_root --- rpcs3/Emu/VFS.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index 309c3455d6..9058abeb7d 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -203,20 +203,21 @@ std::string vfs::get(std::string_view vpath, std::vector* out_dir) if (dir.first == name) { list.back() = &dir.second; + + if (dir.second.path == "/"sv) + { + if (vpath.empty()) + { + return {}; + } + + // Handle /host_root (not escaped, not processed) + return std::string{vpath.substr(1)}; + } + break; } } - - if (last->path == "/") - { - if (vpath.empty()) - { - return {}; - } - - // Handle /host_root (not escaped, not processed) - return std::string{vpath.substr(1)}; - } } if (result_base.empty())