File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,13 +45,13 @@ Token nextToken(Token tkn) throws IOException {
4545
4646 // read the next char and set eol
4747 int c = in .read ();
48-
49- /* note: unfortunately isEndOfLine may consumes a character silently.
50- * this has no effect outside of the method. so a simple workaround
51- * is to call 'readAgain' on the stream...
52- */
48+ /*
49+ * Note:
50+ * The following call will swallow LF if c == CR.
51+ * But we don't need to know if the last char
52+ * was CR or LF - they are equivalent here.
53+ */
5354 boolean eol = isEndOfLine (c );
54- c = in .readAgain ();
5555
5656 // empty line detection: eol AND (last char was EOL or beginning)
5757 if (emptyLinesIgnored ) {
@@ -60,7 +60,6 @@ Token nextToken(Token tkn) throws IOException {
6060 lastChar = c ;
6161 c = in .read ();
6262 eol = isEndOfLine (c );
63- c = in .readAgain ();
6463 // reached end of file without any content (empty line at the end)
6564 if (isEndOfFile (c )) {
6665 tkn .type = EOF ;
You can’t perform that action at this time.
0 commit comments