summary refs log tree commit diff stats
path: root/compiler/nimrod.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-09-20 00:56:48 +0200
committerAraq <rumpf_a@web.de>2011-09-20 00:56:48 +0200
commitfd62116f6eb80d1dd3d6cc745d80629ad32dca1a (patch)
treeac5cbd102ffa580e322eda22deeef9298babae4a /compiler/nimrod.nim
parentdc3ace4f379931f2af4dd4a3cd2a0984a94865af (diff)
downloadNim-fd62116f6eb80d1dd3d6cc745d80629ad32dca1a.tar.gz
bugfixes for generics; new threads implementation still broken
Diffstat (limited to 'compiler/nimrod.nim')
-rwxr-xr-xcompiler/nimrod.nim14
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/nimrod.nim b/compiler/nimrod.nim
index 5c91329cd..3a910cfad 100755
--- a/compiler/nimrod.nim
+++ b/compiler/nimrod.nim
@@ -49,6 +49,13 @@ proc ProcessCmdLine(pass: TCmdLinePass, command, filename: var string) =
     if optRun notin gGlobalOptions and arguments != "": 
       rawMessage(errArgsNeedRunOption, [])
   
+proc prependCurDir(f: string): string =
+  when defined(unix):
+    if os.isAbsolute(f): result = f
+    else: result = "./" & f
+  else:
+    result = f
+  
 proc HandleCmdLine() = 
   var start = epochTime()
   if paramCount() == 0: 
@@ -79,11 +86,8 @@ proc HandleCmdLine() =
         rawMessage(hintSuccessX, [$gLinesCompiled, 
                    formatFloat(epochTime() - start, ffDecimal, 3)])
       if optRun in gGlobalOptions: 
-        when defined(unix): 
-          var prog = "./" & quoteIfContainsWhite(changeFileExt(filename, ""))
-        else: 
-          var prog = quoteIfContainsWhite(changeFileExt(filename, ""))
-        execExternalProgram(prog & ' ' & arguments)
+        var ex = quoteIfContainsWhite(changeFileExt(filename, "").prependCurDir)
+        execExternalProgram(ex & ' ' & arguments)
 
 #GC_disableMarkAndSweep()
 cmdLineInfo = newLineInfo("command line", -1, -1)