Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions include/internal/basic_csv_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ namespace csv {
while (this->data_pos < in.size() && parse_flag(in[this->data_pos]) == ParseFlags::NEWLINE)
this->data_pos++;

// End of record -> Write record
this->push_field();
this->push_row();
// End of record -> Write non-empty record
if (this->field_length > 0 || !this->current_row.empty()) {
this->push_field();
this->push_row();
}

// Reset
this->current_row = CSVRow(data_ptr, this->data_pos, fields->size());
Expand Down
8 changes: 5 additions & 3 deletions single_include/csv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7084,9 +7084,11 @@ namespace csv {
while (this->data_pos < in.size() && parse_flag(in[this->data_pos]) == ParseFlags::NEWLINE)
this->data_pos++;

// End of record -> Write record
this->push_field();
this->push_row();
// End of record -> Write non-empty record
if (this->field_length > 0 || !this->current_row.empty()) {
this->push_field();
this->push_row();
}

// Reset
this->current_row = CSVRow(data_ptr, this->data_pos, fields->size());
Expand Down
8 changes: 5 additions & 3 deletions single_include_test/csv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7084,9 +7084,11 @@ namespace csv {
while (this->data_pos < in.size() && parse_flag(in[this->data_pos]) == ParseFlags::NEWLINE)
this->data_pos++;

// End of record -> Write record
this->push_field();
this->push_row();
// End of record -> Write non-empty record
if (this->field_length > 0 || !this->current_row.empty()) {
this->push_field();
this->push_row();
}

// Reset
this->current_row = CSVRow(data_ptr, this->data_pos, fields->size());
Expand Down