private_fl_fss_basic_read(buffer, F_true, range, found, quote, delimits, state);
- if (F_status_is_error(state->status) || state->status == F_fss_found_object_not || state->status == F_data_not || state->status == F_data_not_eos || state->status == F_data_not_stop) {
+ if (state->status == F_status_set_error(F_fss_found_object_content_not)) {
+
+ // The private function sets the error bit on unterminated quoted Object.
+ state->status = F_fss_found_object_content_not;
+ }
+ else if (F_status_is_error(state->status) || state->status == F_fss_found_object_not || state->status == F_data_not || state->status == F_data_not_eos || state->status == F_data_not_stop) {
delimits->used = delimits_used;
}
}
private_fl_fss_basic_read(buffer, F_false, range, &content_partial, "e, delimits, state);
- if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
- state->status = f_string_ranges_increase(state->step_small, found);
+ if (state->status == F_fss_found_object || F_status_set_fine(state->status) == F_fss_found_object_content_not) {
+ status = f_string_ranges_increase(state->step_small, found);
- if (F_status_is_error_not(state->status) && quotes) {
- state->status = f_uint8s_increase(state->step_small, quotes);
+ if (F_status_is_error_not(status) && quotes) {
+ status = f_uint8s_increase(state->step_small, quotes);
+ }
+
+ // The private function sets the error bit on unterminated quoted Object.
+ if (state->status == F_status_set_error(F_fss_found_object_content_not)) {
+ state->status = F_fss_found_object_content_not;
}
if (F_status_is_error(status)) {
private_fl_fss_basic_read(buffer, F_true, range, found, quote, delimits, state);
- if (F_status_is_error(state->status) || state->status == F_fss_found_object_not || state->status == F_data_not || state->status == F_data_not_eos || state->status == F_data_not_stop) {
+ if (state->status == F_status_set_error(F_fss_found_object_content_not)) {
+
+ // The private function sets the error bit on unterminated quoted Object.
+ state->status = F_fss_found_object_content_not;
+ }
+ else if (F_status_is_error(state->status) || state->status == F_fss_found_object_not || state->status == F_data_not || state->status == F_data_not_eos || state->status == F_data_not_stop) {
delimits->used = delimits_used;
}
return;
}
+ // Save the delimits used position in case of unterminated quote.
+ const f_array_length_t delimits_used = delimits->used;
+
// Begin the search.
found->start = range->start;
}
else if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
+ // The quote is incomplete, so treat the entire line as the Object as per the specification (including the quotes).
+ // The error bit is set to designate that the Object is found in an erroneous state (not having a terminating quote).
+ found->start -= 1;
+ found->stop = range->start - 1;
+ state->status = F_status_set_error(F_fss_found_object_content_not);
+
+ // The delimits cannot be preserved in this case as per specification.
+ delimits->used = delimits_used;
+
// Move the start position to after the EOL.
++range->start;
- state->status = F_fss_found_object_not;
return;
}
* F_end_not_group_eos if EOS was reached before the a group termination was reached.
* F_end_not_group_stop if stop point was reached before the a group termination was reached.
*
+ * F_fss_found_object_content_not (with error bit) If an unterminated quoted Object is found.
* F_interrupt (with error bit) if stopping due to an interrupt.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_parameter (with error bit) if a parameter is invalid.