From: Kevin Day Date: Fri, 6 Jan 2023 03:57:27 +0000 (-0600) Subject: Bugfix: Support for passing a fakefile Section incorrectly fails. X-Git-Tag: 0.6.3~39 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=1a532716db0d3b3f48b326ccbf144255279327c3;p=fll Bugfix: Support for passing a fakefile Section incorrectly fails. The commit 25671e39d0a275b4a14b1db6612ae46d497c38c7 added a loop around the code. I forget to handle the return status and break out of the loop appropriately. Move the variable declaration outside of the loop to avoid re-declaring it inside. An error or a child signal should cause the loop to terminate. When the string comparison is matched, do not continue processing the inner loop. --- diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index dd21b4a..f5aab14 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -175,6 +175,8 @@ extern "C" { } } else { + int result = 0; + for (i = 0; i < data->main->parameters.remaining.used; ++i) { index = data->main->parameters.remaining.array[i]; @@ -185,30 +187,36 @@ extern "C" { if (fl_string_dynamic_partial_compare(data->main->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) { { - const int result = fake_make_operate_section(&data_make, j, §ion_stack, &status); + int result = fake_make_operate_section(&data_make, j, §ion_stack, &status); if (status == F_child) { data->main->child = result; + + break; } } - if (status != F_child) { - const f_status_t status_path = f_path_change_at(data_make.path.top.id); + const f_status_t status_path = f_path_change_at(data_make.path.top.id); - if (F_status_is_error(status_path) && data->main->warning.verbosity >= f_console_verbosity_verbose_e) { - flockfile(data->main->warning.to.stream); + if (F_status_is_error(status_path) && data->main->warning.verbosity >= f_console_verbosity_verbose_e) { + flockfile(data->main->warning.to.stream); - fl_print_format("%r%[%QFailed change back to orignal path '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context); - fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, data_make.path.stack.array[0], data->main->warning.notable); - fl_print_format("%[', status code =%] ", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context); - fl_print_format("%[%ui%]", data->main->warning.to.stream, data->main->warning.notable, F_status_set_fine(status_path), data->main->warning.notable); - fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s); + fl_print_format("%r%[%QFailed change back to orignal path '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context); + fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, data_make.path.stack.array[0], data->main->warning.notable); + fl_print_format("%[', status code =%] ", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context); + fl_print_format("%[%ui%]", data->main->warning.to.stream, data->main->warning.notable, F_status_set_fine(status_path), data->main->warning.notable); + fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s); - funlockfile(data->main->warning.to.stream); - } + funlockfile(data->main->warning.to.stream); } + + break; } + + if (F_status_is_error(status)) break; } // for + + if (status == F_child || F_status_is_error(status)) break; } // for } }