projects
/
haskell-directory.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2004-11-14 20:25:54 by panne]
[haskell-directory.git]
/
System
/
Directory.hs
diff --git
a/System/Directory.hs
b/System/Directory.hs
index
50e77ab
..
d3133d4
100644
(file)
--- a/
System/Directory.hs
+++ b/
System/Directory.hs
@@
-523,11
+523,7
@@
findExecutable binary = do
path <- getEnv "PATH"
search (parseSearchPath path)
where
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
search :: [FilePath] -> IO (Maybe FilePath)
search [] = return Nothing
@@
-537,6
+533,14
@@
findExecutable binary = do
if b then return (Just path)
else search ds
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/.
#ifdef __GLASGOW_HASKELL__
{- |@'getDirectoryContents' dir@ returns a list of /all/ entries
in /dir/.