aboutsummaryrefslogtreecommitdiff
path: root/Utility/Path.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-06 00:48:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-06 00:48:47 -0400
commitd23c3f7d501fb716ae6c9763b0ed6d219372a018 (patch)
tree5ff0d1ccbbfdff869c7c1a698b3b19bb4305e9ad /Utility/Path.hs
parent0878f9051291c5035c3c0ab3beefab4871410ed4 (diff)
Windows: Look for .exe extension when searching for a command in path.
Diffstat (limited to 'Utility/Path.hs')
-rw-r--r--Utility/Path.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Utility/Path.hs b/Utility/Path.hs
index 8c78409b8..216b2401d 100644
--- a/Utility/Path.hs
+++ b/Utility/Path.hs
@@ -181,7 +181,12 @@ searchPath command
| otherwise = getSearchPath >>= getM indir
where
indir d = check $ d </> command
- check f = ifM (doesFileExist f) ( return (Just f), return Nothing )
+ check f = firstM doesFileExist
+#ifdef __WINDOWS__
+ [f, f ++ ".exe"]
+#else
+ [f]
+#endif
{- Checks if a filename is a unix dotfile. All files inside dotdirs
- count as dotfiles. -}