[project @ 2005-01-27 14:38:29 by simonmar]
[ghc-hetmet.git] / ghc / utils / runghc / runghc.hs
index 55e622a..22719a3 100644 (file)
@@ -45,9 +45,9 @@ main = do
        dieProg "syntax: runghc [-f GHCPATH] FILE ARG..."
 
 doIt ghc filename args = do
-  res <- rawSystem ghc ["-e","System.Environment.withArgs ["
+  res <- rawSystem ghc ["-e","System.Environment.withProgName "++show filename++" (System.Environment.withArgs ["
                        ++ concat (intersperse "," (map show args))
-                       ++ "] Main.main", filename]
+                       ++ "] Main.main)", filename]
   exitWith res
 
 dieProg :: String -> IO a