-- 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 ->
-> Ptr CString
-> IO CInt
#else
+ do
path <- getEnv "PATH"
search (parseSearchPath path)
where