bugfix: typos in os.nim
This commit is contained in:
parent
05d12897a2
commit
c11398ea0d
1 changed files with 3 additions and 3 deletions
|
|
@ -598,11 +598,11 @@ iterator parentDirs*(path: string, fromRoot=false, inclusive=true): string =
|
||||||
proc `/../` * (head, tail: string): string {.noSideEffect.} =
|
proc `/../` * (head, tail: string): string {.noSideEffect.} =
|
||||||
## The same as ``parentDir(head) / tail`` unless there is no parent directory.
|
## The same as ``parentDir(head) / tail`` unless there is no parent directory.
|
||||||
## Then ``head / tail`` is performed instead.
|
## Then ``head / tail`` is performed instead.
|
||||||
let sepPos = parentDirPos(path)
|
let sepPos = parentDirPos(head)
|
||||||
if sepPos >= 0:
|
if sepPos >= 0:
|
||||||
result = substr(path, 0, sepPos-1) / tail
|
result = substr(head, 0, sepPos-1) / tail
|
||||||
else:
|
else:
|
||||||
result = path / tail
|
result = head / tail
|
||||||
|
|
||||||
proc normExt(ext: string): string =
|
proc normExt(ext: string): string =
|
||||||
if ext == "" or ext[0] == extSep: result = ext # no copy needed here
|
if ext == "" or ext[0] == extSep: result = ext # no copy needed here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue