projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
afd1006
)
[project @ 2001-07-17 18:47:52 by sof]
author
sof
<unknown>
Tue, 17 Jul 2001 18:47:52 +0000
(18:47 +0000)
committer
sof
<unknown>
Tue, 17 Jul 2001 18:47:52 +0000
(18:47 +0000)
wibble
ghc/compiler/main/SysTools.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/main/SysTools.lhs
b/ghc/compiler/main/SysTools.lhs
index
5489b38
..
2ac9d27
100644
(file)
--- a/
ghc/compiler/main/SysTools.lhs
+++ b/
ghc/compiler/main/SysTools.lhs
@@
-688,13
+688,14
@@
slash s1 s2 = s1 ++ ('/' : s2)
#if defined(mingw32_TARGET_OS)
getExecDir :: IO (Maybe String)
#if defined(mingw32_TARGET_OS)
getExecDir :: IO (Maybe String)
-getExecDir = do let len = 2048
+getExecDir = do let len = 2048 -- plenty, PATH_MAX is 512 under Win32.
buf <- mallocArray (fromIntegral len)
ret <- getModuleFileName nullAddr buf len
if ret == 0 then return Nothing
else do s <- peekCString buf
destructArray (fromIntegral len) buf
buf <- mallocArray (fromIntegral len)
ret <- getModuleFileName nullAddr buf len
if ret == 0 then return Nothing
else do s <- peekCString buf
destructArray (fromIntegral len) buf
- return (Just (reverse (tail (dropWhile (not . isSlash) (reverse (unDosifyPath s))))))
+ return (Just (reverse (drop (length "/bin/ghc.exe") (reverse (unDosifyPath n)))))
+
foreign import stdcall "GetModuleFileNameA" getModuleFileName :: Addr -> CString -> Int32 -> IO Int32
#else
foreign import stdcall "GetModuleFileNameA" getModuleFileName :: Addr -> CString -> Int32 -> IO Int32
#else