Commit 3b65655c authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot
Browse files

SysTools: Only apply Windows-specific workaround on Windows

Issue #1110 was apparently due to a bug in Vista which prevented GCC
from finding its binaries unless we explicitly added it to PATH.
However, this workaround was incorrectly applied on non-Windows
platforms as well, resulting in ill-formed PATHs (#17266).

Fixes #17266.
parent 3c916162
Pipeline #12128 passed with stages
in 519 minutes and 36 seconds
...@@ -83,16 +83,22 @@ getGccEnv opts = ...@@ -83,16 +83,22 @@ getGccEnv opts =
if null b_dirs if null b_dirs
then return Nothing then return Nothing
else do env <- getEnvironment else do env <- getEnvironment
return (Just (map mangle_path env)) return (Just (mangle_paths env))
where where
(b_dirs, _) = partitionWith get_b_opt opts (b_dirs, _) = partitionWith get_b_opt opts
get_b_opt (Option ('-':'B':dir)) = Left dir get_b_opt (Option ('-':'B':dir)) = Left dir
get_b_opt other = Right other get_b_opt other = Right other
-- Work around #1110 on Windows only (lest we stumble into #17266).
#if defined(mingw32_HOST_OS)
mangle_paths = map mangle_path
mangle_path (path,paths) | map toUpper path == "PATH" mangle_path (path,paths) | map toUpper path == "PATH"
= (path, '\"' : head b_dirs ++ "\";" ++ paths) = (path, '\"' : head b_dirs ++ "\";" ++ paths)
mangle_path other = other mangle_path other = other
#else
mangle_paths = id
#endif
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment