if (data->main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) {
f_array_length_t line_current = 0;
+ f_array_length_t delimit = 0;
uint8_t newline_missing = F_true;
flockfile(data->main->output.to.stream);
break;
}
+ if (delimit < contents_delimits->used) {
+ while (contents_delimits->array[delimit] < j) ++delimit;
+
+ if (delimit < contents_delimits->used && j == contents_delimits->array[delimit]) {
+ ++delimit;
+
+ continue;
+ }
+ }
+
f_print_character(data->buffer.string[j], data->main->output.to.stream);
} // for
}
void fss_embedded_list_read_process_delimits(fss_embedded_list_read_data_t * const data, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) {
if (!data->nest.used) return;
-
- if ((!objects_delimits->used && !contents_delimits->used) || data->delimit_mode == fss_embedded_list_read_delimit_mode_all_e) return;
+ if (!objects_delimits->used && !contents_delimits->used || data->delimit_mode == fss_embedded_list_read_delimit_mode_all_e) return;
if (data->delimit_mode == fss_embedded_list_read_delimit_mode_depth_lesser_e && data->nest.used < data->delimit_depth) return;
if (data->delimit_mode == fss_embedded_list_read_delimit_mode_depth_greater_e && data->delimit_depth == 0) return;
fss_embedded_list_read_process_delimits_objects(data, data->delimit_depth, original_contents_delimits, original_contents_used, contents_delimits);
}
else {
- fss_embedded_list_read_process_delimits_objects(data, data->delimit_depth, original_objects_delimits, original_objects_used, objects_delimits);
+ fss_embedded_list_read_process_delimits_objects(data, 0, original_objects_delimits, original_objects_used, objects_delimits);
}
fss_embedded_list_read_process_delimits_contents(data, data->delimit_depth, original_contents_delimits, original_contents_used, contents_delimits);
} // for
}
else if (data->delimit_mode == fss_embedded_list_read_delimit_mode_depth_greater_e) {
- for (f_array_length_t i = data->delimit_depth; i < data->nest.used; ++i) {
+
+ // Only depth 0 objects are stored in objects_delimits.
+ if (!data->delimit_depth) {
+ fss_embedded_list_read_process_delimits_objects(data, 0, original_objects_delimits, original_objects_used, objects_delimits);
+ fss_embedded_list_read_process_delimits_contents(data, 0, original_contents_delimits, original_contents_used, contents_delimits);
+ }
+
+ for (f_array_length_t i = data->delimit_depth + 1; i < data->nest.used; ++i) {
fss_embedded_list_read_process_delimits_objects(data, i, original_contents_delimits, original_contents_used, contents_delimits);
fss_embedded_list_read_process_delimits_contents(data, i, original_contents_delimits, original_contents_used, contents_delimits);