mirror of
https://github.com/nim-lang/Nim.git
synced 2026-03-03 23:28:31 +00:00
bugfix: typos in os.nim
This commit is contained in:
@@ -598,11 +598,11 @@ iterator parentDirs*(path: string, fromRoot=false, inclusive=true): string =
|
||||
proc `/../` * (head, tail: string): string {.noSideEffect.} =
|
||||
## The same as ``parentDir(head) / tail`` unless there is no parent directory.
|
||||
## Then ``head / tail`` is performed instead.
|
||||
let sepPos = parentDirPos(path)
|
||||
let sepPos = parentDirPos(head)
|
||||
if sepPos >= 0:
|
||||
result = substr(path, 0, sepPos-1) / tail
|
||||
result = substr(head, 0, sepPos-1) / tail
|
||||
else:
|
||||
result = path / tail
|
||||
result = head / tail
|
||||
|
||||
proc normExt(ext: string): string =
|
||||
if ext == "" or ext[0] == extSep: result = ext # no copy needed here
|
||||
|
||||
Reference in New Issue
Block a user