diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-08-03 01:03:44 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-08-03 01:11:42 -0700 |
commit | a37fa4cbba40fa233e43d04847865b08d43ec5cc (patch) | |
tree | f072f0df9a638e42a3649bda06aafcbb601eae4b | |
parent | 69b436bec5d70f3d8b9ca6dda0f538d266a5a3c2 (diff) |
til: always apply filters in til_module_setup_full()
The filter bypass was kind of a hack and resulted in unfiltered
module lists in rkt_scener edits.
Now that there's an explicit syntax for bypassing checks, the
user can just do that to access what's filtered. So get back to
appropriately consistent filtered results.
-rw-r--r-- | src/til.c | 34 |
1 files changed, 13 insertions, 21 deletions
@@ -544,32 +544,24 @@ int til_module_setup_full(const til_settings_t *settings, til_setting_t **res_se module_name = til_settings_get_value_by_idx(settings, 0, &setting); if (!module_name || !setting->desc) { - const char *values[nelems(modules) + 1] = {}; - const char *annotations[nelems(modules) + 1] = {}; - int r, filtered = 1; - - /* Only disable filtering if a *valid* module_name is providead. - * This is so fat-fingered names don't suddenly include a bunch of broken options. - */ - if (module_name && til_lookup_module(module_name)) - filtered = 0; + const char *values[nelems(modules) + 1] = {}; + const char *annotations[nelems(modules) + 1] = {}; + int r; for (unsigned i = 0, j = 0; i < nelems(modules); i++) { - if (filtered) { - if (modules[i]->flags & flags_excluded) - continue; - - if (exclusions) { - const char *excl = *exclusions; + if (modules[i]->flags & flags_excluded) + continue; - for (; excl; excl++) { - if (!strcasecmp(excl, modules[i]->name)) - break; - } + if (exclusions) { + const char *excl = *exclusions; - if (excl) - continue; + for (; excl; excl++) { + if (!strcasecmp(excl, modules[i]->name)) + break; } + + if (excl) + continue; } values[j] = modules[i]->name; |