diff options
author | 2018-05-28 07:49:27 -0700 | |
---|---|---|
committer | 2018-05-28 07:50:36 -0700 | |
commit | 4015862b5ef068ec649df7123df63b23ea36185d (patch) | |
tree | 21fbbe8d279c4160af16e57ba0e9a02f9c1c7834 /src/main/java/com/google/devtools/build/lib/windows | |
parent | a9c0d4e41efa3fc684de3065e74b9a6f82ec260d (diff) |
Windows: Make environment variables case-insensitive when creating Windows process
If users pass the same environment variables with different cases,
the last one will override the previous ones.
Fixed https://github.com/bazelbuild/bazel/issues/5285
Change-Id: Ieec857553bc54a4ad9809455687551303037e240
PiperOrigin-RevId: 198303684
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/windows')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/windows/WindowsSubprocessFactory.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/windows/WindowsSubprocessFactory.java b/src/main/java/com/google/devtools/build/lib/windows/WindowsSubprocessFactory.java index af591cc7e8..c9a39943fa 100644 --- a/src/main/java/com/google/devtools/build/lib/windows/WindowsSubprocessFactory.java +++ b/src/main/java/com/google/devtools/build/lib/windows/WindowsSubprocessFactory.java @@ -118,7 +118,7 @@ public class WindowsSubprocessFactory implements SubprocessFactory { * Converts an environment map to the format expected in lpEnvironment by CreateProcess(). */ private byte[] convertEnvToNative(Map<String, String> env) throws IOException { - Map<String, String> realEnv = new TreeMap<>(); + Map<String, String> realEnv = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); realEnv.putAll(env == null ? System.getenv() : env); if (getSystemRoot(realEnv) == null) { // Some versions of MSVCRT.DLL require SystemRoot to be set. It's quite a common library to |