From bbee5f1baec132f8b47ae80303ce22f7d7787cd8 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 12 Jan 2018 16:05:19 +0100 Subject: Add an ugly hack to our parser to make the writing of configuration rules more obvious. --- src/sp_config_keywords.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/sp_config_keywords.c') diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index c5cc950..dad538c 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c @@ -336,7 +336,18 @@ int parse_disabled_functions(char *line) { } if (param) { - df->param = parse_var(param); + if (strlen(param) > 0) { + /* This is an ugly hack. We're prefixing with a `$` because otherwise + * the parser treats this as a constant. + * FIXME: Remote this, and improve our (weird) parser. */ + char *new = pecalloc(strlen(param) + 2, 1, 1); + new[0] = '$'; + memcpy(new + 1, param, strlen(param)); + df->param = parse_var(new); + free(new); + } else { + df->param = parse_var(param); + } if (!df->param) { sp_log_err("config", "Invalid value '%s' for `param` on line %zu.", param, sp_line_no); -- cgit v1.3