Skip to content

Commit

Permalink
'findExecutable' "" should return Nothing, like on linux
Browse files Browse the repository at this point in the history
Fixes #180
  • Loading branch information
hasufell committed Aug 17, 2024
1 parent 367241f commit 7582869
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions System/Directory/Internal/Windows.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,12 @@ canonicalizePathSimplify path =
pure path

searchPathEnvForExes :: OsString -> IO (Maybe OsPath)
searchPathEnvForExes (OsString binary) =
(OsString <$>) <$>
Win32.searchPath Nothing binary (Just (getOsString exeExtension))
searchPathEnvForExes (OsString binary) = search `catch` \e ->
if ioeGetErrorType e == InvalidArgument
then pure Nothing
else throwIO e
where
search = (OsString <$>) <$> Win32.searchPath Nothing binary (Just (getOsString exeExtension))

findExecutablesLazyInternal :: ([OsPath] -> OsString -> ListT IO OsPath)
-> OsString
Expand Down

0 comments on commit 7582869

Please sign in to comment.