From a9301f4836a4bf22d18283103cfcd446eaaec1eb Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 12 Nov 2020 19:42:33 +0100 Subject: Harmonize a bit the configuration parsing and fix a typo --- src/sp_config_keywords.c | 8 ++++---- .../broken_configuration/broken_conf_mutually_exclusive.phpt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index c3a9c19..7d9fbdf 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c @@ -378,11 +378,11 @@ int parse_disabled_functions(char *line) { return 1; \ } - MUTUALLY_EXCLUSIVE(df->value, df->r_value, "value", "regexp"); + MUTUALLY_EXCLUSIVE(df->r_value, df->value, "r_value", "value"); MUTUALLY_EXCLUSIVE(df->r_function, df->function, "r_function", "function"); - MUTUALLY_EXCLUSIVE(df->filename, df->r_filename, "r_filename", "filename"); - MUTUALLY_EXCLUSIVE(df->ret, df->r_ret, "r_ret", "ret"); - MUTUALLY_EXCLUSIVE(df->key, df->r_key, "r_key", "key"); + MUTUALLY_EXCLUSIVE(df->r_filename, df->filename, "r_filename", "filename"); + MUTUALLY_EXCLUSIVE(df->r_ret, df->ret, "r_ret", "ret"); + MUTUALLY_EXCLUSIVE(df->r_key, df->key, "r_key", "key"); #undef MUTUALLY_EXCLUSIVE if (1 < diff --git a/src/tests/broken_configuration/broken_conf_mutually_exclusive.phpt b/src/tests/broken_configuration/broken_conf_mutually_exclusive.phpt index ccbcc6e..44ef0aa 100644 --- a/src/tests/broken_configuration/broken_conf_mutually_exclusive.phpt +++ b/src/tests/broken_configuration/broken_conf_mutually_exclusive.phpt @@ -6,6 +6,6 @@ Broken configuration sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive.ini --FILE-- --EXPECT-- -PHP Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").value_r("^id$").drop();': '.value' and '.regexp' are mutually exclusive on line 1 in Unknown on line 0 +PHP Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").value_r("^id$").drop();': '.r_value' and '.value' are mutually exclusive on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").value_r("^id$").drop();': '.value' and '.regexp' are mutually exclusive on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").value_r("^id$").drop();': '.r_value' and '.value' are mutually exclusive on line 1 in Unknown on line 0 -- cgit v1.3