From: Kevin Day Date: Thu, 10 Apr 2025 03:51:18 +0000 (-0500) Subject: Bugfix: The fl_directory_do() needs to operate on the parent directory during recursion. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;ds=sidebyside;p=fll Bugfix: The fl_directory_do() needs to operate on the parent directory during recursion. The parent directory must be processed after recursion during the recursion steps. These should not have the `f_directory_recurse_do_flag_top_after_e` flags because these are not top level. These must have action because the action is expected to be performed on the directory just like other file types. --- diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index 659bbc0..fc17ce2 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -199,12 +199,14 @@ extern "C" { --recurse->depth; } - else { - recurse->action(recurse, recurse->listing.directory.array[i], f_directory_recurse_do_flag_directory_e); - if (F_status_is_error(recurse->state.status)) { - private_inline_fl_directory_do_handle(recurse, recurse->listing.directory.array[i], f_directory_recurse_do_flag_directory_e); - } + // This loop is not considered a loop for breaking and continuing. + if (recurse->state.status == F_break || recurse->state.status == F_done || recurse->state.status == F_continue || F_status_set_fine(recurse->state.status) == F_interrupt) break; + + recurse->action(recurse, recurse->listing.directory.array[i], f_directory_recurse_do_flag_action_e | f_directory_recurse_do_flag_directory_e); + + if (F_status_is_error(recurse->state.status)) { + private_inline_fl_directory_do_handle(recurse, recurse->listing.directory.array[i], f_directory_recurse_do_flag_action_e | f_directory_recurse_do_flag_directory_e); } // This loop is not considered a loop for breaking and continuing.