Commit 8b40c306 authored by sof's avatar sof
Browse files

[project @ 2002-02-16 19:39:51 by sof]

Use Foreign.free instead of destructArray (which seem to have disappeared)
parent 07c1fd55
......@@ -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)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment