diff options
author | Araq <rumpf_a@web.de> | 2015-01-26 21:38:39 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-01-27 01:36:19 +0100 |
commit | 26b853923cbbd92b9b74cf1b9dce773b0ff39cf3 (patch) | |
tree | 6ccfe4b728b2469b69fe4a884f393b51dc22ab26 /lib | |
parent | 217390d18192e87534e61b9d15c55d44b7e163f7 (diff) | |
download | Nim-26b853923cbbd92b9b74cf1b9dce773b0ff39cf3.tar.gz |
nimsuggest: first version
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/os.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 4981c6f12..147614d3d 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -599,7 +599,7 @@ proc splitPath*(path: string): tuple[head, tail: string] {. proc parentDirPos(path: string): int = var q = 1 - if path[len(path)-1] in {DirSep, AltSep}: q = 2 + if len(path) >= 1 and path[len(path)-1] in {DirSep, AltSep}: q = 2 for i in countdown(len(path)-q, 0): if path[i] in {DirSep, AltSep}: return i result = -1 |