[*] Harden normalize path

This commit is contained in:
Reece Wilson 2023-03-05 09:16:09 +00:00
parent 3e7e5e769a
commit a550a6f58f

View File

@ -110,7 +110,15 @@ namespace Aurora::IO::FS
{
if (ch == "..")
{
auto i = result.size() - 1 - (result[result.size() - 1] == kPathSplitter);
if (!result.size()) continue;
auto i = result.size() - 1;
if (i != 0)
{
i -= (result[result.size() - 1] == kPathSplitter);
}
while (i > 0 && result[i] != kPathSplitter)
{
--i;