From 8b40c3066b1819e14a583d1ccd147ff62d47ff7c Mon Sep 17 00:00:00 2001 From: sof Date: Sat, 16 Feb 2002 19:39:51 +0000 Subject: [PATCH] [project @ 2002-02-16 19:39:51 by sof] Use Foreign.free instead of destructArray (which seem to have disappeared) --- ghc/compiler/main/SysTools.lhs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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))))) -- 1.7.10.4