Skip to content

Commit

Permalink
Add the last newline ignoring
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelS239 committed Dec 19, 2023
1 parent 11b7b97 commit 21b2713
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/parser/csv_parser/csv_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ void CSVParser::GetLine(unsigned long long const line_index) {

void CSVParser::GetNextIfHas() {
has_next_ = !source_.eof();

/* Check for the last newline */
if (has_next_) {
source_.get();
if (source_.eof()) {
has_next_ = false;
}
source_.unget();
}

if (has_next_) {
GetNext();
}
Expand Down

0 comments on commit 21b2713

Please sign in to comment.