diff options
author | Tomohiro <gpuppur@gmail.com> | 2018-07-02 07:46:56 +0900 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-02 00:46:56 +0200 |
commit | a2b2bc1a36a8526fa33e013057a65ae1b7d86b79 (patch) | |
tree | 7f42b836fe3b115453acee59f6255781904324b0 | |
parent | dbbe311e18e1c7a2ecf6d9788010400161507532 (diff) | |
download | Nim-a2b2bc1a36a8526fa33e013057a65ae1b7d86b79.tar.gz |
Fixed #8173 (#8175)
-rw-r--r-- | lib/pure/ospaths.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim index 905a65925..d9097d419 100644 --- a/lib/pure/ospaths.nim +++ b/lib/pure/ospaths.nim @@ -449,6 +449,9 @@ proc unixToNativePath*(path: string, drive=""): string {. when defined(unix): result = path else: + if path.len == 0: + return "" + var start: int if path[0] == '/': # an absolute path @@ -462,7 +465,7 @@ proc unixToNativePath*(path: string, drive=""): string {. else: result = $DirSep start = 1 - elif path[0] == '.' and path[1] == '/': + elif path[0] == '.' and (path.len == 1 or path[1] == '/'): # current directory result = $CurDir start = 2 |