summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/pure/ospaths.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim
index 96996bba7..305052e41 100644
--- a/lib/pure/ospaths.nim
+++ b/lib/pure/ospaths.nim
@@ -186,7 +186,7 @@ proc joinPath*(head, tail: string): string {.
   if len(head) == 0:
     result = tail
   elif head[len(head)-1] in {DirSep, AltSep}:
-    if tail[0] in {DirSep, AltSep}:
+    if tail.len > 0 and tail[0] in {DirSep, AltSep}:
       result = head & substr(tail, 1)
     else:
       result = head & tail