From: Kevin Day Date: Thu, 3 Dec 2020 03:26:45 +0000 (-0600) Subject: Update: controller program should better handle code bits and also clear used. X-Git-Tag: 0.5.2~44 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=13037bf83bccf32ffc697e37ae7bd390e1f82823;p=fll Update: controller program should better handle code bits and also clear used. Fix a problem where the bitwise code test needs to be inverted to be logically correct. When skipping position 0 for main in entry item read, ensure that the string is not used. --- diff --git a/level_3/controller/c/private-entry.c b/level_3/controller/c/private-entry.c index 49a40ba..4129cf9 100644 --- a/level_3/controller/c/private-entry.c +++ b/level_3/controller/c/private-entry.c @@ -633,7 +633,7 @@ extern "C" { break; } - for (j = code & 0x1 ? 1 : 0; j < entry->items.used; ++j) { + for (j = (code & 0x1) ? 1 : 0; j < entry->items.used; ++j) { if (fl_string_dynamic_compare(entry->items.array[j].name, cache->name_item) == F_equal_to) { if (data.warning.verbosity != f_console_verbosity_quiet) { @@ -669,8 +669,9 @@ extern "C" { else { // skip position 0, which is reserved for "main". - at = 1; + entry->items.array[0].name.used = 0; + at = 1; entry->items.used = 2; } @@ -705,7 +706,7 @@ extern "C" { cache->name_action.used = 0; cache->name_item.used = 0; - if (code & 0x1) { + if (!(code & 0x1)) { if (data.error.verbosity != f_console_verbosity_quiet) { fprintf(data.error.to.stream, "%c", f_string_eol[0]); fprintf(data.error.to.stream, "%s%sThe required entry item '", data.error.context.before->string, data.error.prefix ? data.error.prefix : "");