const f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quote, delimits);
+ // The private function sets the error bit on unterminated quoted Object.
+ if (status == F_status_set_error(F_fss_found_object_content_not)) {
+ return F_fss_found_object_content_not;
+ }
+
if (F_status_is_error(status) || status == F_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) {
delimits->used = delimits_used;
}
status = private_fl_fss_basic_read(buffer, F_false, state, range, &content_partial, "e, delimits);
- if (status == F_fss_found_object || status == F_fss_found_object_content_not) {
+ if (status == F_fss_found_object || F_status_set_fine(status) == F_fss_found_object_content_not) {
status_allocate = f_string_ranges_increase(state.step_small, found);
if (F_status_is_error_not(status_allocate) && quotes) {
status_allocate = f_uint8s_increase(state.step_small, quotes);
}
+ // The private function sets the error bit on unterminated quoted Object.
+ if (status == F_status_set_error(F_fss_found_object_content_not)) {
+ status = F_fss_found_object_content_not;
+ }
+
if (F_status_is_error(status_allocate)) {
delimits->used = delimits_used;
const f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quote, delimits);
+ // The private function sets the error bit on unterminated quoted Object.
+ if (status == F_status_set_error(F_fss_found_object_content_not)) {
+ return F_fss_found_object_content_not;
+ }
+
if (F_status_is_error(status) || status == F_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) {
delimits->used = delimits_used;
}
if (status == F_none_stop) return F_data_not_stop;
if (status == F_data_not) return status;
+ // 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;
+
+ // 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;
- return F_fss_found_object_not;
+ return F_status_set_error(F_fss_found_object_content_not);
}
status = f_utf_buffer_increment(buffer, range, 1);
* 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.