ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: svn commit: r446979 - in /ant/core/trunk: CONTRIBUTORS WHATSNEW contributors.xml src/main/org/apache/tools/ant/taskdefs/Execute.java
Date Mon, 18 Sep 2006 13:24:01 GMT
On 9/16/06, peterreilly@apache.org <peterreilly@apache.org> wrote:
> bugzilla 28874: make env case insensitive for windows
> @@ -624,9 +627,17 @@
>         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;
>                 }

Peter, can you please explain this patch a bit? I've also been bitten
by the case of (PATH | Path | path) on Windows in the past, but solved
it by assigning the Path's current env key and value to 2 properties,
to ensure I was using the same case when assigning it for a
sub-process.

This is different than forcing env keys to be lower-case
(case-insensitive), and that worries me a bit franckly... In my
experience, the path *must* be assigned using the same case used by
the Ant process, and going to all lower-case doesn't do that. This is
critical when forking any process (<java>, <junit>, <exec>) that
depends on Path (or PATH, or path) to be set properly to run.

Thanks for any insight on this. Right-now I worried about this. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message