Merge pull request #100075 from demolke/simplify

Fix handling of leading `..` in simplify_path
This commit is contained in:
Thaddeus Crews 2024-12-09 14:33:34 -06:00
commit 4b1a51d3e3
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84
2 changed files with 5 additions and 1 deletions

View file

@ -4599,7 +4599,7 @@ String String::simplify_path() const {
dirs.remove_at(i);
i--;
} else if (d == "..") {
if (i != 0) {
if (i != 0 && dirs[i - 1] != "..") {
dirs.remove_at(i);
dirs.remove_at(i - 1);
i -= 2;