]> Kevux Git Server - fll/commitdiff
Bugfix: The fl_directory_do() needs to pass f_directory_recurse_do_flag_directory_e...
authorKevin Day <Kevin@kevux.org>
Fri, 4 Apr 2025 00:46:57 +0000 (19:46 -0500)
committerKevin Day <Kevin@kevux.org>
Fri, 4 Apr 2025 00:49:27 +0000 (19:49 -0500)
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

index 7b112710e2779ad78285bdb073bf715c7d06ce6b..5e319b291a8896d668442f79321aed3a58e7574e 100644 (file)
@@ -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;
       }
     }