ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umag...@apache.org
Subject cvs commit: jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters TailFilter.java
Date Mon, 04 Mar 2002 23:59:37 GMT
umagesh     02/03/04 15:59:37

  Modified:    proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters
                        TailFilter.java
  Log:
  Make TailFilter behave exactly like the unix tail application.
  
  Revision  Changes    Path
  1.9       +4 -3      jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/TailFilter.java
  
  Index: TailFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/sandbox/filterreaders/src/main/org/apache/tools/ant/filters/TailFilter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TailFilter.java	4 Mar 2002 22:17:26 -0000	1.8
  +++ TailFilter.java	4 Mar 2002 23:59:36 -0000	1.9
  @@ -146,18 +146,19 @@
                       }
                   }
   
  -                if (ch == '\n') {
  +                if (ch == '\n' || ch == -1) {
                       ++linesRead;
   
                       if (linesRead == lines) {
                           int i = 0;
                           for (i = returnedCharPos + 1;
  -                                buffer[i] != 0 && buffer[i] != '\n'; i++) {
  +                            buffer[i] != 0 && buffer[i] != '\n'; i++) {
                           }
                           returnedCharPos = i;
                           --linesRead;
                       }
  -                } else if (ch == -1) {
  +                }
  +                if (ch == -1) {
                       break;
                   }
   
  
  
  

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


Mime
View raw message