[*] Harden normalize path
This commit is contained in:
parent
3e7e5e769a
commit
a550a6f58f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user