From f2ad42777ddf96038e08a29cce81acc1b426ae1e Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 3 Aug 2023 17:02:57 -0700 Subject: til_settings: honor til_setting_t.nocheck in spec_check Trivial refactor s/til_setting_spec_check/til_setting_check_spec/ so it operates on a til_setting_t as opposed to the bare value. With the containing til_setting_t onhand it can be responsible for bypassing the check when til_setting_t.nocheck is set. Adjusted callers in setup_interactively() and rkt_scener_update() accordingly. --- src/modules/rkt/rkt_scener.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/rkt') diff --git a/src/modules/rkt/rkt_scener.c b/src/modules/rkt/rkt_scener.c index 25650c8..c491531 100644 --- a/src/modules/rkt/rkt_scener.c +++ b/src/modules/rkt/rkt_scener.c @@ -1061,8 +1061,8 @@ int rkt_scener_update(rkt_context_t *ctxt) } } - if (!setting->nocheck && til_setting_spec_check(&desc->spec, setting->value) < 0) { - /* setting invalid! go back to prompting for input */ + r = til_setting_check_spec(setting, &desc->spec); + if (r < 0) { /* setting invalid! go back to prompting for input */ scener->new_scene.cur_invalid = setting; return rkt_scener_send_error(scener, EINVAL, RKT_SCENER_FSM_SEND_NEWSCENE_SETUP_PROMPT); -- cgit v1.2.3