VFS: fixup handling . and .. after #9528

This commit is contained in:
Nekotekina 2021-01-05 16:10:37 +03:00
parent 673e84920b
commit 6ae1f1b02c
1 changed files with 3 additions and 5 deletions

View File

@ -291,12 +291,10 @@ std::string vfs::escape(std::string_view name, bool escape_slash)
{
std::string result;
if (name.size() > 2 && name.find_first_not_of('.') == umax)
if (name.size() <= 2 && name.find_first_not_of('.') == umax)
{
// Name contains only dots, not allowed on Windows.
result.reserve(name.size() + 2);
result += reinterpret_cast<const char*>(u8"");
result += name.substr(1);
// Return . or .. as is
result = name;
return result;
}