From 2eebf4c7067e0aa82ebb3811a03aea11fd5ae8ba Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 3 Apr 2025 19:46:57 -0500 Subject: [PATCH] Bugfix: The fl_directory_do() needs to pass f_directory_recurse_do_flag_directory_e at the top. At the top, before recursion, the path is known to be a directory. The flag `f_directory_recurse_do_flag_directory_e` must be passed to the callbacks to let the callbacks know this is a directory. --- level_1/fl_directory/c/directory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 7b11271..5e319b2 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -121,10 +121,10 @@ extern "C" { if (recurse->flag & f_directory_recurse_do_flag_top_before_e) { recurse->state.status = F_okay; - recurse->action(recurse, path, f_directory_recurse_do_flag_top_before_e); + recurse->action(recurse, path, f_directory_recurse_do_flag_top_before_e | f_directory_recurse_do_flag_directory_e); if (F_status_is_error(recurse->state.status)) { - private_inline_fl_directory_do_handle(recurse, path, f_directory_recurse_do_flag_top_before_e); + private_inline_fl_directory_do_handle(recurse, path, f_directory_recurse_do_flag_top_before_e | f_directory_recurse_do_flag_directory_e); if (F_status_is_error(recurse->state.status)) return; } @@ -173,10 +173,10 @@ extern "C" { } if (recurse->flag & f_directory_recurse_do_flag_list_e) { - recurse->action(recurse, path, f_directory_recurse_do_flag_list_e); + recurse->action(recurse, path, f_directory_recurse_do_flag_directory_e | f_directory_recurse_do_flag_list_e); if (F_status_is_error(recurse->state.status)) { - private_inline_fl_directory_do_handle(recurse, path, f_directory_recurse_do_flag_list_e); + private_inline_fl_directory_do_handle(recurse, path, f_directory_recurse_do_flag_directory_e | f_directory_recurse_do_flag_list_e); if (F_status_is_error(recurse->state.status)) return; } @@ -206,10 +206,10 @@ extern "C" { if (recurse->flag & f_directory_recurse_do_flag_top_after_e) { recurse->state.status = F_okay; - recurse->action(recurse, path, f_directory_recurse_do_flag_action_e | f_directory_recurse_do_flag_top_after_e); + recurse->action(recurse, path, f_directory_recurse_do_flag_action_e | f_directory_recurse_do_flag_directory_e | f_directory_recurse_do_flag_top_after_e); if (F_status_is_error(recurse->state.status)) { - private_inline_fl_directory_do_handle(recurse, path, f_directory_recurse_do_flag_action_e | f_directory_recurse_do_flag_top_after_e); + private_inline_fl_directory_do_handle(recurse, path, f_directory_recurse_do_flag_action_e | f_directory_recurse_do_flag_directory_e | f_directory_recurse_do_flag_top_after_e); if (F_status_is_error(recurse->state.status)) return; } } -- 1.8.3.1