diff options
| author | jvoisin | 2017-10-18 17:04:44 +0200 |
|---|---|---|
| committer | jvoisin | 2017-10-18 17:04:44 +0200 |
| commit | 066b79abe9943821240ccc3a458e8ba45b9ee9e8 (patch) | |
| tree | 69b4cecad32571120b9cd6edbdc2f0525805fa9d /src | |
| parent | 76dc2f2d18abadafcb76aa5cae37ec9a73081d32 (diff) | |
`.pos` is mutuaally exclusive with .param and .paran_r
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_config_keywords.c | 4 | ||||
| -rw-r--r-- | src/tests/broken_conf_mutually_exclusive4.phpt | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index b03c28e..097d08b 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -204,10 +204,10 @@ int parse_disabled_functions(char *line) { | |||
| 204 | "'.r_filename' and '.filename' are mutually exclusive on line %zu.", | 204 | "'.r_filename' and '.filename' are mutually exclusive on line %zu.", |
| 205 | line, sp_line_no); | 205 | line, sp_line_no); |
| 206 | return -1; | 206 | return -1; |
| 207 | } else if (df->r_param && df->param) { | 207 | } else if (1 < ((df->r_param?1:0) + (df->param?1:0) + ((-1 != df->pos)?1:0))) { |
| 208 | sp_log_err("config", | 208 | sp_log_err("config", |
| 209 | "Invalid configuration line: 'sp.disabled_functions%s':" | 209 | "Invalid configuration line: 'sp.disabled_functions%s':" |
| 210 | "'.r_param' and '.param' are mutually exclusive on line %zu.", | 210 | "'.r_param', '.param' and '.pos' are mutually exclusive on line %zu.", |
| 211 | line, sp_line_no); | 211 | line, sp_line_no); |
| 212 | return -1; | 212 | return -1; |
| 213 | } else if (df->r_ret && df->ret) { | 213 | } else if (df->r_ret && df->ret) { |
diff --git a/src/tests/broken_conf_mutually_exclusive4.phpt b/src/tests/broken_conf_mutually_exclusive4.phpt index 4e888f5..a60f3fa 100644 --- a/src/tests/broken_conf_mutually_exclusive4.phpt +++ b/src/tests/broken_conf_mutually_exclusive4.phpt | |||
| @@ -6,4 +6,4 @@ Broken configuration | |||
| 6 | sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive4.ini | 6 | sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive4.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | --EXPECT-- | 8 | --EXPECT-- |
| 9 | [snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param' and '.param' are mutually exclusive on line 1. \ No newline at end of file | 9 | [snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param', '.param' and '.pos' are mutually exclusive on line 1. |
