From b07dcecc6ae6abdc9ff7fab0179475903740ce43 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 15 May 2023 18:51:24 -0700 Subject: til: fix til_setup_module() skip-experimental bug Commit d72e924a introduced skipping experimental modules for the values, but it didn't bring in a new index for storing the values so the offset w/skips was being used to store the values too. This created a sparse set of values for the setup, manifesting as a wonky partial interactive setup for the module that didn't even include the default 0 (rtv) value in the list. Simple fix. --- src/til.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/til.c b/src/til.c index e71b6a0..c00cf93 100644 --- a/src/til.c +++ b/src/til.c @@ -278,12 +278,13 @@ int til_module_setup(const til_settings_t *settings, til_setting_t **res_setting til_setting_desc_t *desc; int r; - for (unsigned i = 0; i < nelems(modules); i++) { + for (unsigned i = 0, j = 0; i < nelems(modules); i++) { if ((modules[i]->flags & TIL_MODULE_EXPERIMENTAL)) continue; - values[i] = modules[i]->name; - annotations[i] = modules[i]->description; + values[j] = modules[i]->name; + annotations[j] = modules[i]->description; + j++; } r = til_setting_desc_new( settings, -- cgit v1.2.3