File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -458,12 +458,22 @@ enum zsv_status zsv_finish(struct zsv_scanner *scanner) {
458458 }
459459 if (scanner -> quote_close_position > 0 &&
460460 scanner -> cell_start + scanner -> quote_close_position >= scanner -> buff .size ) {
461+ // the below does not work if !scanner->free_buff
462+ // use scanner_pre_parse() instead to shift the row over
463+ // then append '"' to the end
464+ size_t new_end = scanner -> buff .size - scanner -> row_start ;
465+
466+ scanner_pre_parse (scanner );
467+ scanner -> buff .buff [new_end ] = '"' ;
468+ /*
461469 size_t new_size = scanner->cell_start + scanner->quote_close_position + 1;
470+
462471 void *mem = realloc(scanner->buff.buff, new_size);
463472 if (!mem)
464473 return zsv_status_memory;
465474 scanner->buff.buff = mem;
466475 scanner->buff.size = new_size;
476+ */
467477 }
468478 }
469479
You can’t perform that action at this time.
0 commit comments