Windows: Look for .exe extension when searching for a command in path.

This commit is contained in:
Joey Hess 2013-07-06 00:48:47 -04:00
parent 74ad3072e4
commit 86b845ff8d
2 changed files with 7 additions and 1 deletions

View file

@ -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. -}