Skip to content

Commit 7c2cfea

Browse files
committed
lastChar cannot possibly be EOF if it is CR, LF or UNDEFINED
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306073 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0a0f3bb commit 7c2cfea

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/main/java/org/apache/commons/csv/CSVLexer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ Token nextToken(Token tkn) throws IOException {
5454

5555
// empty line detection: eol AND (last char was EOL or beginning)
5656
if (emptyLinesIgnored) {
57-
while (eol
58-
&& (lastChar == '\n' || lastChar == '\r' || lastChar == ExtendedBufferedReader.UNDEFINED)
59-
&& !isEndOfFile(lastChar)) {
57+
while (eol && (lastChar == '\n' || lastChar == '\r' || lastChar == ExtendedBufferedReader.UNDEFINED)) {
6058
// go on char ahead ...
6159
lastChar = c;
6260
c = in.read();

0 commit comments

Comments
 (0)