summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/koch.nim b/koch.nim
index 7bb7ea402..d51b902ee 100644
--- a/koch.nim
+++ b/koch.nim
@@ -97,7 +97,7 @@ proc exec(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
     if not absolute.isAbsolute:
       absolute = getCurrentDir() / absolute
     echo("Adding to $PATH: ", absolute)
-    putEnv("PATH", prevPath & PathSep & absolute)
+    putEnv("PATH", (if prevPath.len > 0: prevPath & PathSep else: "") & absolute)
   echo(cmd)
   if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
   putEnv("PATH", prevPath)
@@ -402,7 +402,7 @@ proc winReleaseArch(arch: string) =
 
   template withMingw(path, body) =
     let prevPath = getEnv("PATH")
-    putEnv("PATH", path & PathSep & prevPath)
+    putEnv("PATH", (if path.len > 0: path & PathSep else: "") & prevPath)
     try:
       body
     finally: