mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-29 09:32:42 +00:00
VFS: escape multidot names like ...
This commit is contained in:
parent
5d78d81c00
commit
0c65a1721d
@ -280,6 +280,16 @@ using char2 = char;
|
|||||||
std::string vfs::escape(std::string_view path, bool escape_slash)
|
std::string vfs::escape(std::string_view path, bool escape_slash)
|
||||||
{
|
{
|
||||||
std::string result;
|
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<const char*>(u8".");
|
||||||
|
result += path.substr(1);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
result.reserve(path.size());
|
result.reserve(path.size());
|
||||||
|
|
||||||
for (std::size_t i = 0, s = path.size(); i < s; i++)
|
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;
|
result += c;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case char2{u8"."[2]}:
|
||||||
|
{
|
||||||
|
result += '.';
|
||||||
|
break;
|
||||||
|
}
|
||||||
case char2{u8"<"[2]}:
|
case char2{u8"<"[2]}:
|
||||||
{
|
{
|
||||||
result += '<';
|
result += '<';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user