ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Exec.java Javadoc.java
Date Sun, 06 Feb 2000 21:16:57 GMT
rubys       00/02/06 13:16:57

  Modified:    src/main/org/apache/tools/ant/taskdefs Exec.java
                        Javadoc.java
  Log:
  1) Correct potential infinite loops when parsing invalid Java source
  2) Correct Stefano's mailing address
  3) Correct handling of escaped quotes in strings
  4) Return exit code from the exec'd process as it may be useful
  
  Submitted by: Michael Smith <michael@sneakerlabs.com>
  
  Revision  Changes    Path
  1.8       +7 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java
  
  Index: Exec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Exec.java	2000/02/06 01:17:23	1.7
  +++ Exec.java	2000/02/06 21:16:57	1.8
  @@ -76,15 +76,17 @@
           run(command);
       }
   
  -    protected void run(String command) throws BuildException {
  +    protected int run(String command) throws BuildException {
   
  +        int err = -1; // assume the worst
  +
           // test if os match
           String myos = System.getProperty("os.name");
           project.log("Myos = " + myos, Project.MSG_VERBOSE);
           if ((os != null) && (os.indexOf(myos) < 0)){
               // this command will be executed only on the specified OS
               project.log("Not found in " + os, Project.MSG_VERBOSE);
  -            return;
  +            return 0;
           }
   
           if (myos.toLowerCase().indexOf("windows") >= 0) {
  @@ -131,13 +133,15 @@
               if (fos != null) fos.close();
   
               // check its exit value
  -            int err = proc.exitValue();
  +            err = proc.exitValue();
               if (err != 0) {
                   project.log("Result: " + err, "exec", Project.MSG_ERR);
               }
           } catch (IOException ioe) {
               throw new BuildException("Error exec: " + command );
           } catch (InterruptedException ex) {}
  +
  +        return err;
       }
   
       public void setDir(String d) {
  
  
  
  1.5       +7 -6      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Javadoc.java	2000/02/06 19:28:54	1.4
  +++ Javadoc.java	2000/02/06 21:16:57	1.5
  @@ -74,7 +74,7 @@
    * System.exit() that would break Ant functionality.
    *
    * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a>
  - * @author Stefano Mazzocchi <a href="mailto:stefano@pache.org">stefano@apache.org</a>
  + * @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
    */
   
   public class Javadoc extends Exec {
  @@ -571,9 +571,9 @@
               if (c == '/') {
                   c = in.read();
                   if (c == '/') {
  -                    while (c != '\n') c = in.read();
  +                    while (c != '\n' && c != -1) c = in.read();
                   } else if (c == '*') {
  -                    while (true) {
  +                    while (c != -1) {
                           c = in.read();
                           if (c == '*') {
                               c = in.read();
  @@ -586,10 +586,11 @@
                   }
               }
               if (c == '"') {
  -                while (true) {
  +                while (c != -1) {
                       c = in.read();
  -                    if (c == '\\') c = in.read();
  -                    if (c == '"') {
  +                    if (c == '\\') {
  +                        c = in.read();
  +                    } else if (c == '"') {
                           c = read();
                           break;
                       }
  
  
  

Mime
View raw message