Skip to content

Commit

Permalink
PATHEXT env var and support for "." on Windows PATH #2225
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jun 6, 2016
1 parent cde532e commit d5b8a77
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/System/Process/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ mkEnvOverride platform tm' = do
return EnvOverride
{ eoTextMap = tm
, eoStringList = map (T.unpack *** T.unpack) $ Map.toList tm
, eoPath = maybe [] (FP.splitSearchPath . T.unpack) (Map.lookup "PATH" tm)
, eoPath =
(if isWindows then (".":) else id)
(maybe [] (FP.splitSearchPath . T.unpack) (Map.lookup "PATH" tm))
, eoExeCache = ref
, eoExeExtensions =
if isWindows
then ["", ".exe", ".bat", ".com"]
then case Map.lookup "PATHEXT" tm of
Nothing -> ["", ".exe", ".bat", ".com"]
Just t -> map T.unpack $ "" : T.splitOn ";" t
else [""]
, eoPlatform = platform
}
Expand Down

0 comments on commit d5b8a77

Please sign in to comment.