summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/SysTools/Process.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/main/SysTools/Process.hs b/compiler/main/SysTools/Process.hs
index 2e0e502b63..7ad2cf2f53 100644
--- a/compiler/main/SysTools/Process.hs
+++ b/compiler/main/SysTools/Process.hs
@@ -83,16 +83,22 @@ getGccEnv opts =
if null b_dirs
then return Nothing
else do env <- getEnvironment
- return (Just (map mangle_path env))
+ return (Just (mangle_paths env))
where
(b_dirs, _) = partitionWith get_b_opt opts
get_b_opt (Option ('-':'B':dir)) = Left dir
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"
= (path, '\"' : head b_dirs ++ "\";" ++ paths)
mangle_path other = other
+#else
+ mangle_paths = id
+#endif
-----------------------------------------------------------------------------