Merge pull request #100075 from demolke/simplify
Fix handling of leading `..` in simplify_path
This commit is contained in:
commit
4b1a51d3e3
2 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue