parent
357edd86b4
commit
62c113ebc7
4 changed files with 21 additions and 0 deletions
|
|
@ -76,6 +76,11 @@ proc addNormalizePath*(x: string; result: var string; state: var int;
|
|||
if (state shr 1) >= 1:
|
||||
var d = result.len
|
||||
# f/..
|
||||
# We could handle stripping trailing sep here: foo// => foo like this:
|
||||
# while (d-1) > (state and 1) and result[d-1] in {DirSep, AltSep}: dec d
|
||||
# but right now we instead handle it inside os.joinPath
|
||||
|
||||
# strip path component: foo/bar => foo
|
||||
while (d-1) > (state and 1) and result[d-1] notin {DirSep, AltSep}:
|
||||
dec d
|
||||
if d > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue