ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Execute.java
Date Tue, 30 Mar 2004 23:22:14 GMT
mbenson     2004/03/30 15:22:14

  Modified:    src/main/org/apache/tools/ant/taskdefs Execute.java
  Log:
  Add Windows 2003 support to getProcEnvCommand() + minor refactoring.
  PR:  28067
  Submitted by:	Irene Rusman
  
  Revision  Changes    Path
  1.76      +10 -16    ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- Execute.java	9 Mar 2004 16:48:04 -0000	1.75
  +++ Execute.java	30 Mar 2004 23:22:14 -0000	1.76
  @@ -208,18 +208,15 @@
       private static String[] getProcEnvCommand() {
           if (Os.isFamily("os/2")) {
               // OS/2 - use same mechanism as Windows 2000
  -            String[] cmd = {"cmd", "/c", "set" };
  -            return cmd;
  +            return new String[] {"cmd", "/c", "set" };
           } else if (Os.isFamily("windows")) {
               // Determine if we're running under XP/2000/NT or 98/95
  -            if (!Os.isFamily("win9x")) {
  -                // Windows XP/2000/NT
  -                String[] cmd = {"cmd", "/c", "set" };
  -                return cmd;
  -            } else {
  +            if (Os.isFamily("win9x")) {
                   // Windows 98/95
  -                String[] cmd = {"command.com", "/c", "set" };
  -                return cmd;
  +                return new String[] {"command.com", "/c", "set" };
  +            } else {
  +                // Windows XP/2000/NT/2003
  +                return new String[] {"cmd", "/c", "set" };
               }
           } else if (Os.isFamily("z/os") || Os.isFamily("unix")) {
               // On most systems one could use: /bin/sh -c env
  @@ -237,16 +234,13 @@
               return cmd;
           } else if (Os.isFamily("netware") || Os.isFamily("os/400")) {
               // rely on PATH
  -            String[] cmd = {"env"};
  -            return cmd;
  +            return new String[] {"env"};
           } else if (Os.isFamily("openvms")) {
  -            String[] cmd = {"show", "logical"};
  -            return cmd;
  +            return new String[] {"show", "logical"};
           } else {
               // MAC OS 9 and previous
               //TODO: I have no idea how to get it, someone must fix it
  -            String[] cmd = null;
  -            return cmd;
  +            return null;
           }
       }
   
  
  
  

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


Mime
View raw message