You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/03/27 07:05:46 UTC

[GitHub] [commons-csv] dota17 commented on a change in pull request #60: Fix CSV-149 and CSV-195

dota17 commented on a change in pull request #60: Fix CSV-149 and CSV-195
URL: https://github.com/apache/commons-csv/pull/60#discussion_r399069923
 
 

 ##########
 File path: src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
 ##########
 @@ -88,11 +89,13 @@ public int read(final char[] buf, final int offset, final int length) throws IOE
 
             for (int i = offset; i < offset + len; i++) {
                 final char ch = buf[i];
+                final int previous = i > 0 ? buf[i - 1] : lastChar;
                 if (ch == LF) {
-                    if (CR != (i > 0 ? buf[i - 1] : lastChar)) {
+                    if (CR != previous) {
                         eolCounter++;
                     }
-                } else if (ch == CR) {
+                } else if ((ch == CR)
+                        || (ch == END_OF_STREAM && previous != LF && previous != CR)) {
 
 Review comment:
   thanks ,you are right,that code is useless. I have remove it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services