summary refs log tree commit diff stats
path: root/lib/pure/pathnorm.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/pathnorm.nim')
-rw-r--r--lib/pure/pathnorm.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/pathnorm.nim b/lib/pure/pathnorm.nim
index 407ec156c..3659e85e6 100644
--- a/lib/pure/pathnorm.nim
+++ b/lib/pure/pathnorm.nim
@@ -69,7 +69,8 @@ proc addNormalizePath*(x: string; result: var string; state: var int;
   while hasNext(it, x):
     let b = next(it, x)
     if (state shr 1 == 0) and isSlash(x, b):
-      result.add dirSep
+      if result.len == 0 or result[^1] notin {DirSep, AltSep}:
+        result.add dirSep
       state = state or 1
     elif isDotDot(x, b):
       if (state shr 1) >= 1: