X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FDirectory.hs;h=d3133d4206ab61270c80d9241c5b5b57d43bb758;hb=fb4b15fd8da7e36a2a7aee70fe0b084096f76a1a;hp=50e77abed895aa612ec1bbb04095dffc4b93f73e;hpb=b3e13e24b24d6c2aede318db7be33929c4e4feb8;p=ghc-base.git diff --git a/System/Directory.hs b/System/Directory.hs index 50e77ab..d3133d4 100644 --- a/System/Directory.hs +++ b/System/Directory.hs @@ -523,11 +523,7 @@ findExecutable binary = do path <- getEnv "PATH" search (parseSearchPath path) where -#ifdef mingw32_TARGET_OS - fileName = binary `joinFileExt` "exe" -#else - fileName = binary -#endif + fileName = binary `joinFileExt` drop 1 exeExt search :: [FilePath] -> IO (Maybe FilePath) search [] = return Nothing @@ -537,6 +533,14 @@ findExecutable binary = do if b then return (Just path) else search ds +-- ToDo: This should be determined via autoconf (AC_EXEEXT) +exeExt :: String +#ifdef mingw32_TARGET_OS +exeExt = ".exe" +#else +exeExt = "" +#endif + #ifdef __GLASGOW_HASKELL__ {- |@'getDirectoryContents' dir@ returns a list of /all/ entries in /dir/.