From: simonmar Date: Tue, 25 Oct 2005 12:01:11 +0000 (+0000) Subject: [project @ 2005-10-25 12:01:11 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~30 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a9fdb62ed158c777921127e2351bed89e9f06074;p=haskell-directory.git [project @ 2005-10-25 12:01:11 by simonmar] fix findExecutable (I hope; don't have an up to date Windows build to test on). --- diff --git a/System/Directory.hs b/System/Directory.hs index 8b7dee3..ec4e5a7 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -576,7 +576,7 @@ canonicalizePath fpath = return fpath -- such executable. For example (findExecutable \"ghc\") -- gives you the path to GHC. findExecutable :: String -> IO (Maybe FilePath) -findExecutable binary = do +findExecutable binary = #if defined(mingw32_HOST_OS) withCString binary $ \c_binary -> withCString ('.':exeExtension) $ \c_ext -> @@ -597,6 +597,7 @@ foreign import stdcall unsafe "SearchPath" -> Ptr CString -> IO CInt #else + do path <- getEnv "PATH" search (parseSearchPath path) where