Skip to content

Commit c8e5350

Browse files
committed
Windows CRLF bug fix, renamed _skipCR to _skipLF to reflect the byte the method is skipping, not the byte that indicates it needs to be called.
1 parent aea3c88 commit c8e5350

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/com/fasterxml/sort/std/RawTextLineReader.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,17 @@ public byte[] readNext() throws IOException
7777
return null;
7878
}
7979
}
80-
final int start = _inputPtr;
8180

8281
// first thing(s) first: skip a linefeed we might have
8382
if (_hadCR) {
84-
if (!_skipCR()) {
83+
if (!_skipLF()) {
8584
return null;
8685
}
8786
}
8887

88+
// set the start point after our call to _skipLF() so that if a linefeed is skipped, we also skip it in Arrays.copyOfRange below
89+
final int start = _inputPtr;
90+
8991
// then common case: we find full row:
9092
final int end = _inputEnd;
9193
while (_inputPtr < end) {
@@ -145,7 +147,7 @@ protected boolean _loadMore() throws IOException
145147
return true;
146148
}
147149

148-
protected boolean _skipCR() throws IOException
150+
protected boolean _skipLF() throws IOException
149151
{
150152
_hadCR = false;
151153
if (_inputBuffer[_inputPtr] == BYTE_LF) {

0 commit comments

Comments
 (0)