james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r732842 - /james/mime4j/trunk/src/main/java/org/apache/james/mime4j/io/RootInputStream.java
Date Thu, 08 Jan 2009 21:59:33 GMT
Author: olegk
Date: Thu Jan  8 13:59:32 2009
New Revision: 732842

URL: http://svn.apache.org/viewvc?rev=732842&view=rev
Log:
MIME4J-60: Made RootInputStream treat consistently with the rest o.a.j.mime4j.io classes (CR-LF
and lone LF count as valid line delimiters)

Modified:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/io/RootInputStream.java

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/io/RootInputStream.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/io/RootInputStream.java?rev=732842&r1=732841&r2=732842&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/io/RootInputStream.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/io/RootInputStream.java Thu Jan
 8 13:59:32 2009
@@ -32,7 +32,6 @@
  */
 public class RootInputStream extends FilterInputStream {
     private int lineNumber = 1;
-    private int prev = -1;
     private boolean truncated = false;
 
     /**
@@ -74,10 +73,9 @@
         }
         
         int b = in.read();
-        if (prev == '\r' && b == '\n') {
+        if (b == '\n') {
             lineNumber++;
         }
-        prev = b;
         return b;
     }
     
@@ -93,10 +91,9 @@
         
         int n = in.read(b, off, len);
         for (int i = off; i < off + n; i++) {
-            if (prev == '\r' && b[i] == '\n') {
+            if (b[i] == '\n') {
                 lineNumber++;
             }
-            prev = b[i];
         }
         return n;
     }



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


Mime
View raw message