diff --git a/include/internal/basic_csv_parser.hpp b/include/internal/basic_csv_parser.hpp index d76b2d9..1a584d8 100644 --- a/include/internal/basic_csv_parser.hpp +++ b/include/internal/basic_csv_parser.hpp @@ -320,6 +320,9 @@ namespace csv { void next(size_t bytes = ITERATION_CHUNK_SIZE) override { if (this->eof()) return; + // Reset parser state + this->field_start = UNINITIALIZED_FIELD; + this->field_length = 0; this->reset_data_ptr(); this->data_ptr->_data = std::make_shared(); diff --git a/single_include/csv.hpp b/single_include/csv.hpp index 811c8e1..82d7672 100644 --- a/single_include/csv.hpp +++ b/single_include/csv.hpp @@ -6159,6 +6159,9 @@ namespace csv { void next(size_t bytes = ITERATION_CHUNK_SIZE) override { if (this->eof()) return; + // Reset parser state + this->field_start = UNINITIALIZED_FIELD; + this->field_length = 0; this->reset_data_ptr(); this->data_ptr->_data = std::make_shared(); diff --git a/single_include_test/csv.hpp b/single_include_test/csv.hpp index 811c8e1..82d7672 100644 --- a/single_include_test/csv.hpp +++ b/single_include_test/csv.hpp @@ -6159,6 +6159,9 @@ namespace csv { void next(size_t bytes = ITERATION_CHUNK_SIZE) override { if (this->eof()) return; + // Reset parser state + this->field_start = UNINITIALIZED_FIELD; + this->field_length = 0; this->reset_data_ptr(); this->data_ptr->_data = std::make_shared();