Skip to content

Commit

Permalink
Fix issue when parsing empty FASTQ reads #451
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rr0 committed Nov 8, 2023
1 parent 04ec2d4 commit 7be981a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,10 +1054,11 @@ pair<bool, int> FastqPatternSource::nextBatchFromFile(
if (previous_was_newline && (c == '\n' || c == '\r'))
continue;
// We've encountered a new record implying that the
// previous record was incomplete. Reset the line count
// and let the parser take care of that.
if (previous_was_newline && c == '@' && newlines > 1) {
newlines = 4;
// previous record was incomplete. Move on to the next
// record, the parser will take care of the partial record.
if (previous_was_newline && c == '@' && newlines != 4) {
ungetc_wrapper(c);
break;
}
previous_was_newline = false;
done = c < 0;
Expand Down

0 comments on commit 7be981a

Please sign in to comment.