]> Kevux Git Server - fll/commitdiff
Update: Reset Controller cache in some cases and do so after error messages.
authorKevin Day <Kevin@kevux.org>
Sun, 23 Jun 2024 01:58:35 +0000 (20:58 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 23 Jun 2024 01:58:35 +0000 (20:58 -0500)
Use the action name item rather than a hard coded string.
Make sure the action name item cache is reset after this rather than before.

Add additional safety reset before appending to action name item cache.

level_3/controller/c/entry/private-entry.c

index 452cb2781e247852b689d06d647eb19ca23cfb22..29a8bf9820c31ac4de6dd4457be69e1004d431ee 100644 (file)
@@ -1739,6 +1739,7 @@ extern "C" {
           }
 
           entry->items.array[at].line = cache->action.line_item;
+          entry->items.array[at].name.used = 0;
 
           status = f_string_dynamic_append_nulless(cache->action.name_item, &entry->items.array[at].name);
 
@@ -1770,15 +1771,12 @@ extern "C" {
         }
 
         if (F_status_is_error_not(status)) {
-          cache->action.name_action.used = 0;
-          cache->action.name_item.used = 0;
-
           if (!(code & 0x1)) {
             if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
               controller_lock_print(global.main->error.to, global.thread);
 
               fl_print_format("%r%[%QThe required %r item '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
-              fl_print_format("%[%r%]", global.main->error.to.stream, global.main->error.notable, controller_main_s, global.main->error.notable);
+              fl_print_format("%[%r%]", global.main->error.to.stream, global.main->error.notable, cache->action.name_item, global.main->error.notable);
               fl_print_format("%[' is not found.%]%r", global.main->error.to.stream, global.main->error.context, global.main->error.context, f_string_eol_s);
 
               controller_unlock_print_flush(global.main->error.to, global.thread);
@@ -1787,6 +1785,9 @@ extern "C" {
             status = F_status_set_error(F_found_not);
           }
 
+          cache->action.name_action.used = 0;
+          cache->action.name_item.used = 0;
+
           if (F_status_is_error_not(status)) {
             controller_entry_action_t *action = 0;