[ https://issues.apache.org/jira/browse/CSV-149?focusedWorklogId=410873&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-410873 ]
ASF GitHub Bot logged work on CSV-149: -------------------------------------- Author: ASF GitHub Bot Created on: 27/Mar/20 07:05 Start Date: 27/Mar/20 07:05 Worklog Time Spent: 10m Work Description: dota17 commented on 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 410873) Time Spent: 1h 20m (was: 1h 10m) > Line number is not proper at EOF > -------------------------------- > > Key: CSV-149 > URL: https://issues.apache.org/jira/browse/CSV-149 > Project: Commons CSV > Issue Type: Bug > Components: Parser > Affects Versions: 1.1 > Environment: CSV 1.1, Java 1.6, Windows OS > Reporter: Kranthi > Priority: Major > Fix For: Patch Needed > > Attachments: csv-145-unit-test.diff > > Time Spent: 1h 20m > Remaining Estimate: 0h > > CSVParser.getCurrentLineNumber() is returning wrong line number (actual line > number - 1) when EOF file is reached without record delimiter (\r\n). -- This message was sent by Atlassian Jira (v8.3.4#803005)