/[classpath]/classpath/java/io/LineNumberReader.java
ViewVC logotype

Diff of /classpath/java/io/LineNumberReader.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by mkoch, Sun Mar 23 10:39:02 2003 UTC revision 1.10 by mkoch, Tue Jun 24 07:25:38 2003 UTC
# Line 374  public class LineNumberReader extends Bu Line 374  public class LineNumberReader extends Bu
374      *      *
375      * @exception IOException If an error occurs      * @exception IOException If an error occurs
376      */      */
377    public long skip(long count) throws IOException    public long skip (long count) throws IOException
378    {    {
     return(super.skip(count));  
     // FIXME: This method not merged from gcj. The code below is the original  
     // gcj code that doesn't work.  I'm not sure if the method above (from  
     // Classpath) is broken or not, but it seems to work correctly in all  
     // methods I've tested.  If somebody wants to investigate why the code  
     // below fails, feel free.  
 /*  
379      if (count <= 0)      if (count <= 0)
380        return 0;        return 0;
381      long to_do = count;  
382      do      int skipped;
383        
384        for (skipped = 0; skipped < count; skipped++)
385        {        {
386          int ch = read();          int ch = read();
387          if (ch < 0)  
388            break;          if (ch < 0)
389          to_do--;            break;
         if (ch == '\n' || ch == '\r')  
           lineNumber++;  
         else  
           {  
             long fence = pos + to_do;  
             if (limit < fence)  
               fence = limit;  
             int end = pos;  
             for (; end < fence; end++)  
               {  
                 char endch = buffer[end];  
                 if (endch == '\n' || endch == '\r')  
                   break;  
               }  
             to_do -= end - pos;  
             pos = end;  
           }  
390        }        }
391      while (to_do > 0);  
392      return count - to_do;      return skipped;
 */  
393    }    }
394  }  }
395    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26