Skip to content

Commit 3c08f7a

Browse files
committed
prevent blocking on lookahead after EOL: SANDBOX-173
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/sandbox/csv/trunk@501543 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0089bfa commit 3c08f7a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/java/org/apache/commons/csv/ExtendedBufferedReader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ public int read() throws IOException {
8181
lookaheadChar = super.read();
8282
}
8383
lastChar = lookaheadChar;
84-
lookaheadChar = super.read();
84+
if (super.ready()) {
85+
lookaheadChar = super.read();
86+
} else {
87+
lookaheadChar = UNDEFINED;
88+
}
8589
if (lastChar == '\n') {
8690
lineCounter++;
8791
}

0 commit comments

Comments
 (0)