VFS: fixup handling . and .. after #9528
This commit is contained in:
+3
-5
@@ -291,12 +291,10 @@ std::string vfs::escape(std::string_view name, bool escape_slash)
|
|||||||
{
|
{
|
||||||
std::string result;
|
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.
|
// Return . or .. as is
|
||||||
result.reserve(name.size() + 2);
|
result = name;
|
||||||
result += reinterpret_cast<const char*>(u8".");
|
|
||||||
result += name.substr(1);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user