From 9b83fc0db946d649d4ee935dfa738b7dbc8cf813 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 22 Mar 2026 17:07:46 +0100 Subject: [PATCH] Allow @if with loadmodule, just not module-loaded(). We need this. --- src/conf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/conf.c b/src/conf.c index 8d807b823..a8defb57e 100644 --- a/src/conf.c +++ b/src/conf.c @@ -2047,10 +2047,9 @@ int config_loadmodules(void) { if (!strcmp(ce->name, "loadmodule")) { - if (ce->conditional_config) + if (ce->conditional_config && ce->conditional_config->condition == IF_MODULE) { - config_error("%s:%d: Currently you cannot have a 'loadmodule' statement " - "within an @if block, sorry.", + config_error("%s:%d: You cannot use @if module-loaded() around a 'loadmodule' statement.", ce->file->filename, ce->line_number); return 0; }