diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index cbc665eb07..974952c9ab 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -280,6 +280,16 @@ using char2 = char; std::string vfs::escape(std::string_view path, bool escape_slash) { std::string result; + + if (path.size() > 2 && path.find_first_not_of('.') == umax) + { + // Path contains only dots, not allowed on Windows. + result.reserve(path.size() + 2); + result += reinterpret_cast(u8"."); + result += path.substr(1); + return result; + } + result.reserve(path.size()); for (std::size_t i = 0, s = path.size(); i < s; i++) @@ -493,6 +503,11 @@ std::string vfs::unescape(std::string_view path) result += c; continue; } + case char2{u8"."[2]}: + { + result += '.'; + break; + } case char2{u8"<"[2]}: { result += '<';