fix: typo in Hledger.Cli.CliOptions.likelyExecutablesInPath

This had a bug noticed by mauke in #haskell: it was splitting PATH
on [ and ] as well as : and ;. Hard to trigger, but now fixed.
This commit is contained in:
Simon Michael 2023-05-27 09:21:49 -10:00
parent 6b3dd79542
commit a12880de05

View File

@ -745,7 +745,7 @@ compiledExts = ["",".com",".exe"]
-- We do not currently filter out non-file objects or files without execute permission.
likelyExecutablesInPath :: IO [String]
likelyExecutablesInPath = do
pathdirs <- splitOneOf "[:;]" `fmap` getEnvSafe "PATH"
pathdirs <- splitOneOf ":;" `fmap` getEnvSafe "PATH"
pathfiles <- concat `fmap` mapM getDirectoryContentsSafe pathdirs
return $ nubSort pathfiles
-- exclude directories and files without execute permission.