From a9fdb62ed158c777921127e2351bed89e9f06074 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 25 Oct 2005 12:01:11 +0000 Subject: [PATCH] [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). --- System/Directory.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 1.7.10.4