From a2b2bc1a36a8526fa33e013057a65ae1b7d86b79 Mon Sep 17 00:00:00 2001 From: Tomohiro Date: Mon, 2 Jul 2018 07:46:56 +0900 Subject: [PATCH] Fixed #8173 (#8175) --- lib/pure/ospaths.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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