path <- getEnv "PATH"
search (parseSearchPath path)
where
-#ifdef mingw32_TARGET_OS
- fileName = binary `joinFileExt` "exe"
-#else
- fileName = binary
-#endif
+ fileName = binary `joinFileExt` drop 1 exeExtension
search :: [FilePath] -> IO (Maybe FilePath)
search [] = return Nothing