summaryrefslogtreecommitdiff
path: root/src/sp_config_keywords.c
diff options
context:
space:
mode:
authorjvoisin2018-01-12 16:05:19 +0100
committerjvoisin2018-01-12 16:57:42 +0100
commitbbee5f1baec132f8b47ae80303ce22f7d7787cd8 (patch)
tree25a99787d40ec1e84310340d8df9809b9fa16dc8 /src/sp_config_keywords.c
parent44255b8dbf5c98c8d110c2e3918298ee6978b93c (diff)
Add an ugly hack to our parser to make the writing of configuration rules more obvious.
Diffstat (limited to 'src/sp_config_keywords.c')
-rw-r--r--src/sp_config_keywords.c13
1 files changed, 12 insertions, 1 deletions
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) {
336 } 336 }
337 337
338 if (param) { 338 if (param) {
339 df->param = parse_var(param); 339 if (strlen(param) > 0) {
340 /* This is an ugly hack. We're prefixing with a `$` because otherwise
341 * the parser treats this as a constant.
342 * FIXME: Remote this, and improve our (weird) parser. */
343 char *new = pecalloc(strlen(param) + 2, 1, 1);
344 new[0] = '$';
345 memcpy(new + 1, param, strlen(param));
346 df->param = parse_var(new);
347 free(new);
348 } else {
349 df->param = parse_var(param);
350 }
340 if (!df->param) { 351 if (!df->param) {
341 sp_log_err("config", "Invalid value '%s' for `param` on line %zu.", param, 352 sp_log_err("config", "Invalid value '%s' for `param` on line %zu.", param,
342 sp_line_no); 353 sp_line_no);