Skip to content

Commit

Permalink
Use better default path extension
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jun 6, 2016
1 parent d5b8a77 commit 35ad01e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/System/Process/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import Data.Foldable (forM_)
import Data.IORef
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (isJust, maybeToList)
import Data.Maybe (isJust, maybeToList, fromMaybe)
import Data.Monoid
import Data.Text (Text)
import qualified Data.Text as T
Expand Down Expand Up @@ -118,9 +118,10 @@ mkEnvOverride platform tm' = do
, eoExeCache = ref
, eoExeExtensions =
if isWindows
then case Map.lookup "PATHEXT" tm of
Nothing -> ["", ".exe", ".bat", ".com"]
Just t -> map T.unpack $ "" : T.splitOn ";" t
then let pathext = fromMaybe
".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
(Map.lookup "PATHEXT" tm)
in map T.unpack $ "" : T.splitOn ";" pathext
else [""]
, eoPlatform = platform
}
Expand Down

0 comments on commit 35ad01e

Please sign in to comment.