From: Kevin Day Date: Sat, 23 Nov 2024 06:27:55 +0000 (-0600) Subject: Bugfix: Incorrect handling of "at" positions in FSS Embedded List Read. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=35d2f71d38f00b4f6085d5246f1bb867217a5151;p=fll Bugfix: Incorrect handling of "at" positions in FSS Embedded List Read. The "at" position needs to be counted during all iterations. --- diff --git a/level_3/fss_read/c/embedded_list/process.c b/level_3/fss_read/c/embedded_list/process.c index fe88ca3..e6f91f3 100644 --- a/level_3/fss_read/c/embedded_list/process.c +++ b/level_3/fss_read/c/embedded_list/process.c @@ -139,27 +139,25 @@ extern "C" { } } // for - if (F_status_is_error_not(main->setting.state.status)) { - f_number_unsigned_t j = 0; + { + f_number_unsigned_t at = 0; fss_read_depth_t * const the = &main->setting.depths.array[0]; for (i = 0; i < main->setting.nest.depth[the->depth].used; ++i) { - if (main->setting.depths.used > 1) { - - // The name and at conditions are only to be matched if not at the last depth. - if (the->index_name) { - if (f_compare_dynamic_partial_trim_string(the->value_name.string, main->setting.buffer, the->value_name.used, main->setting.nest.depth[the->depth].array[i].object) != F_equal_to) continue; - } + if (the->index_name) { + if (f_compare_dynamic_partial_trim_string(the->value_name.string, main->setting.buffer, the->value_name.used, main->setting.nest.depth[the->depth].array[i].object) != F_equal_to) continue; + } - if (the->index_at) { - if (j != the->value_at) { - if (++j > the->value_at) break; + if (the->index_at) { + if (at++ != the->value_at) { + if (at > the->value_at) break; - continue; - } + continue; } + } + if (main->setting.depths.used > 1) { fss_read_embedded_list_process_determine_depth_nest_recurse(main, i, 1); if (F_status_is_error(main->setting.state.status)) break; } @@ -236,28 +234,26 @@ extern "C" { if (!main || !next || next >= main->setting.depths.used) return; f_number_unsigned_t i = 0; - f_number_unsigned_t j = 0; + f_number_unsigned_t at = 0; fss_read_depth_t * const the = &main->setting.depths.array[next]; for (; F_status_is_error_not(main->setting.state.status) && i < main->setting.nest.depth[the->depth].used; ++i) { if (main->setting.nest.depth[the->depth].array[i].parent != parent) continue; - if (next + 1 < main->setting.depths.used) { - - // The name and at conditions are only to be matched if not at the last depth. - if (the->index_name) { - if (f_compare_dynamic_partial_trim_string(the->value_name.string, main->setting.buffer, the->value_name.used, main->setting.nest.depth[the->depth].array[i].object) != F_equal_to) continue; - } + if (the->index_name) { + if (f_compare_dynamic_partial_trim_string(the->value_name.string, main->setting.buffer, the->value_name.used, main->setting.nest.depth[the->depth].array[i].object) != F_equal_to) continue; + } - if (the->index_at) { - if (j != the->value_at) { - if (++j > the->value_at) break; + if (the->index_at) { + if (at++ != the->value_at) { + if (at > the->value_at) break; - continue; - } + continue; } + } + if (next + 1 < main->setting.depths.used) { fss_read_embedded_list_process_determine_depth_nest_recurse(main, i, next + 1); } else {