ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types Commandline.java
Date Sat, 05 Aug 2000 15:11:56 GMT
conor       00/08/05 08:11:56

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        WeblogicDeploymentTool.java
               src/main/org/apache/tools/ant/types Commandline.java
  Log:
  Changes the translateline method so that backslash escaping only applies to
  the quote characters " and '.
  
  Revision  Changes    Path
  1.2       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  
  Index: WeblogicDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WeblogicDeploymentTool.java	2000/08/02 14:30:56	1.1
  +++ WeblogicDeploymentTool.java	2000/08/05 15:11:55	1.2
  @@ -149,7 +149,7 @@
           org.apache.tools.ant.taskdefs.Java javaTask = null;
           
           try {
  -            String args = "-noexit " + sourceJar.getPath().replace('\\', '/') + " " + destJar.getPath().replace('\\',
'/');
  +            String args = "-noexit " + sourceJar.getPath() + " " + destJar.getPath();
               
               javaTask = (Java) getTask().getProject().createTask("java");
               javaTask.setClassname("weblogic.ejbc");
  
  
  
  1.3       +16 -9     jakarta-ant/src/main/org/apache/tools/ant/types/Commandline.java
  
  Index: Commandline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Commandline.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Commandline.java	2000/08/03 11:25:14	1.2
  +++ Commandline.java	2000/08/05 15:11:55	1.3
  @@ -84,9 +84,8 @@
    */
   public class Commandline {
   
  -    private Vector definition = new Vector();
  +    private Vector arguments = new Vector();
       private String executable = null;
  -    private Argument argument = null;
   
       public Commandline(String to_process) {
           super();
  @@ -166,7 +165,7 @@
        */
       public Argument createArgument() {
           Argument argument = new Argument();
  -        definition.addElement(argument);
  +        arguments.addElement(argument);
           return argument;
       }
   
  @@ -209,9 +208,9 @@
        * <code>addValue</code> or the argument object.
        */
       public String[] getArguments() {
  -        Vector result = new Vector(definition.size()*2);
  -        for (int i=0; i<definition.size(); i++) {
  -            Argument arg = (Argument) definition.elementAt(i);
  +        Vector result = new Vector(arguments.size()*2);
  +        for (int i=0; i<arguments.size(); i++) {
  +            Argument arg = (Argument) arguments.elementAt(i);
               String[] s = arg.getParts();
               for (int j=0; j<s.length; j++) {
                   result.addElement(s[j]);
  @@ -300,10 +299,18 @@
                       }
                   } else if ("\\".equals(nextTok)) {
                       if (tok.hasMoreTokens()) {
  -                        current.append(tok.nextToken());
  +                        String escapedToken = tok.nextToken();
  +                        char escapedChar = escapedToken.charAt(0);
  +                        if (escapedChar == '\\' || escapedChar == '\'' ||
  +                             escapedChar == '\"') {
  +                            current.append(escapedToken);
  +                        }
  +                        else {
  +                            current.append("\\" + escapedToken);
  +                        }
                       } else {
  -                        throw new BuildException("stray backslash in "
  -                                                 + to_process);
  +                        // just add the backslash
  +                        current.append("\\");
                       }
                   } else {
                       current.append(nextTok);
  
  
  

Mime
View raw message