Skip to content

Commit 4383e49

Browse files
committed
fix the regression bug causing fastqreader failure
1 parent 25d4600 commit 4383e49

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/fastqreader.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,13 @@ void FastqReader::getLine(string* line){
251251
while(true) {
252252
readToBuf();
253253
start = 0;
254+
end = 0;
254255
// handle the case that \r or \n in the start of buf
255-
while(start < mBufDataLen && (mFastqBuf[start] == '\r' || mFastqBuf[start] == '\n'))
256-
start++;
257-
end = start;
256+
if(line->empty()) {
257+
while(start < mBufDataLen && (mFastqBuf[start] == '\r' || mFastqBuf[start] == '\n'))
258+
start++;
259+
end = start;
260+
}
258261
while(end < mBufDataLen) {
259262
if(mFastqBuf[end] != '\r' && mFastqBuf[end] != '\n')
260263
end++;

0 commit comments

Comments
 (0)