From: sof Date: Sat, 16 Feb 2002 19:39:51 +0000 (+0000) Subject: [project @ 2002-02-16 19:39:51 by sof] X-Git-Tag: Approximately_9120_patches~18 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8b40c3066b1819e14a583d1ccd147ff62d47ff7c;p=ghc-hetmet.git [project @ 2002-02-16 19:39:51 by sof] Use Foreign.free instead of destructArray (which seem to have disappeared) --- diff --git a/ghc/compiler/main/SysTools.lhs b/ghc/compiler/main/SysTools.lhs index ad64752..cb4a6e7 100644 --- a/ghc/compiler/main/SysTools.lhs +++ b/ghc/compiler/main/SysTools.lhs @@ -79,6 +79,7 @@ import qualified Posix #else import List ( isPrefixOf ) import MarshalArray +import Foreign #endif #if __GLASGOW_HASKELL__ > 408 @@ -279,11 +280,11 @@ initSysTools minusB_args tdir <- if ret == 0 then do -- failed, consult TEMP. - destructArray len buf + free buf getEnv "TMP" else do s <- peekCString buf - destructArray len buf + free buf return s let -- strip the trailing backslash (awful, but @@ -835,9 +836,9 @@ getExecDir :: IO (Maybe String) getExecDir = do let len = (2048::Int) -- plenty, PATH_MAX is 512 under Win32. buf <- mallocArray len ret <- getModuleFileName nullAddr buf len - if ret == 0 then destructArray len buf >> return Nothing + if ret == 0 then free buf >> return Nothing else do s <- peekCString buf - destructArray len buf + free buf return (Just (reverse (dropList "/bin/ghc.exe" (reverse (unDosifyPath s)))))