Author: nextgens
Date: 2008-08-17 17:44:13 +0000 (Sun, 17 Aug 2008)
New Revision: 21974

Modified:
   trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
bug #2501: maybe fix problem two

Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2008-08-17 16:10:23 UTC (rev 21973)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2008-08-17 17:44:13 UTC (rev 21974)
@@ -36,7 +36,8 @@
                mark((maxLength+1)*2); // Might be more than maxLengh if we use 
utf8
                while(true) {
                        int x = read(buf, ctr, buf.length - ctr);
-                       if(x == -1) {
+                       if(x == 0) continue;
+                       else if(x == -1) {
                                if(ctr == 0)
                                        return null;
                                return new String(buf, 0, ctr, utf ? "UTF-8" : 
"ISO-8859-1");


Reply via email to