This is caused by the F_data_not return result not being processed in some of the fl_fss functions.
Additional changes:
- Make the return status constant.
- The status is being returned regardless in some cases so remove the effectively redundant lines of code.
- Combined the additional if condition blocks together.
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quote, delimits);
+ const f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quote, delimits);
- if (F_status_is_error(status)) {
+ 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;
}
const f_array_length_t delimits_used = delimits->used;
- f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quoted, delimits);
+ const f_status_t status = private_fl_fss_basic_read(buffer, F_true, state, range, found, quoted, delimits);
- if (F_status_is_error(status)) {
+ 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;
-
- return status;
- }
-
- if (status == F_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) {
- delimits->used = delimits_used;
-
- return status;
}
return status;
return F_fss_found_object_not;
}
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
+ if (status == F_data_not) return status;
// Begin the search.
found->start = range->start;
f_status_t status = f_fss_skip_past_space(state, object, range);
if (F_status_is_error(status)) return status;
- if (status == F_none_eos) {
- return F_data_not_eos;
- }
-
- if (status == F_none_stop) {
- return F_data_not_stop;
- }
-
- if (status == F_none_eol) {
- return F_status_set_error(F_none_eol);
- }
+ if (status == F_none_eos) return F_data_not_eos;
+ if (status == F_none_stop) return F_data_not_stop;
+ if (status == F_none_eol) return F_status_set_error(F_none_eol);
+ if (status == F_data_not) return status;
// Ensure that there is room for the potential start and stop quotes, a potential delimit at start, and the potential object open character.
status = f_string_dynamic_increase_by(5, destination);