diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f11e4257c..3e0c0ec0d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -254,6 +254,7 @@ Wolf Siberski Wolfgang Baer Wolfgang Frech Wolfgang Werner +Xavier Witdouck Yohann Roussel Yuji Yamano Yves Martin diff --git a/WHATSNEW b/WHATSNEW index 3fd4c4eef..824079115 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -9,6 +9,9 @@ Changes that could break older environments: * unrestrict the dbvendor names in the websphere element of the ejbjar task. Bugzilla Report 40475. +* nested element in , and others is now case-insensitive + for windows OS. Bugzilla Report 28826. + Fixed bugs: ----------- diff --git a/contributors.xml b/contributors.xml index 14455ab18..c5b95829d 100644 --- a/contributors.xml +++ b/contributors.xml @@ -1010,6 +1010,10 @@ Wolfgang Werner + + Xavier + Witdouck + Yohann Roussel diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index 11e049a84..1fb79bd3c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -79,6 +79,9 @@ public class Execute { /** Used to destroy processes when the VM exits. */ private static ProcessDestroyer processDestroyer = new ProcessDestroyer(); + /** Used for replacing env variables */ + private static boolean environmentCaseInSensitive = false; + /* * Builds a command launcher for the OS and JVM we are running under. */ @@ -98,7 +101,7 @@ public class Execute { // OS/2 shellLauncher = new OS2CommandLauncher(new CommandLauncher()); } else if (Os.isFamily("windows")) { - + environmentCaseInSensitive = true; CommandLauncher baseLauncher = new CommandLauncher(); if (!Os.isFamily("win9x")) { @@ -624,9 +627,17 @@ public class Execute { for (int i = 0; i < env.length; i++) { // Get key including "=" String key = env[i].substring(0, env[i].indexOf('=') + 1); + if (environmentCaseInSensitive) { + // Nb: using default locale as key is a env name + key = key.toLowerCase(); + } int size = osEnv.size(); for (int j = 0; j < size; j++) { - if (((String) osEnv.elementAt(j)).startsWith(key)) { + String osEnvItem = (String) osEnv.elementAt(j); + if (environmentCaseInSensitive) { + osEnvItem = osEnvItem.toLowerCase(); + } + if (osEnvItem.startsWith(key)) { osEnv.removeElementAt(j); break; }