diff options
| author | jvoisin | 2017-10-10 18:11:31 +0200 |
|---|---|---|
| committer | jvoisin | 2017-10-18 15:27:21 +0200 |
| commit | fe43991e3dc6c46e2781d21369f5e268de7baef9 (patch) | |
| tree | 027471bdcce37397c4b39b6f9fbf252104a2ebde /src/sp_config_keywords.c | |
| parent | e8d255e5cef8949256d3290b2d8fd22de9428a83 (diff) | |
Implement match on arguments position
Diffstat (limited to 'src/sp_config_keywords.c')
| -rw-r--r-- | src/sp_config_keywords.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 29f1bfc..1f48852 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -144,7 +144,9 @@ int parse_cookie_encryption(char *line) { | |||
| 144 | int parse_disabled_functions(char *line) { | 144 | int parse_disabled_functions(char *line) { |
| 145 | int ret = 0; | 145 | int ret = 0; |
| 146 | bool enable = true, disable = false; | 146 | bool enable = true, disable = false; |
| 147 | char *pos = NULL; | ||
| 147 | sp_disabled_function *df = pecalloc(sizeof(*df), 1, 1); | 148 | sp_disabled_function *df = pecalloc(sizeof(*df), 1, 1); |
| 149 | df->pos = -1; | ||
| 148 | 150 | ||
| 149 | sp_config_functions sp_config_funcs_disabled_functions[] = { | 151 | sp_config_functions sp_config_funcs_disabled_functions[] = { |
| 150 | {parse_empty, SP_TOKEN_ENABLE, &(enable)}, | 152 | {parse_empty, SP_TOKEN_ENABLE, &(enable)}, |
| @@ -169,6 +171,7 @@ int parse_disabled_functions(char *line) { | |||
| 169 | {parse_regexp, SP_TOKEN_RET_REGEXP, &(df->r_ret)}, | 171 | {parse_regexp, SP_TOKEN_RET_REGEXP, &(df->r_ret)}, |
| 170 | {parse_php_type, SP_TOKEN_RET_TYPE, &(df->ret_type)}, | 172 | {parse_php_type, SP_TOKEN_RET_TYPE, &(df->ret_type)}, |
| 171 | {parse_str, SP_TOKEN_LOCAL_VAR, &(df->var)}, | 173 | {parse_str, SP_TOKEN_LOCAL_VAR, &(df->var)}, |
| 174 | {parse_str, SP_TOKEN_VALUE_ARG_POS, &(pos)}, | ||
| 172 | {0}}; | 175 | {0}}; |
| 173 | 176 | ||
| 174 | ret = parse_keywords(sp_config_funcs_disabled_functions, line); | 177 | ret = parse_keywords(sp_config_funcs_disabled_functions, line); |
| @@ -233,6 +236,10 @@ int parse_disabled_functions(char *line) { | |||
| 233 | return -1; | 236 | return -1; |
| 234 | } | 237 | } |
| 235 | 238 | ||
| 239 | if (pos) { | ||
| 240 | df->pos = atoi(pos) > 128 ? 128: atoi(pos); // FIXME do the strtol dance | ||
| 241 | } | ||
| 242 | |||
| 236 | if (df->function) { | 243 | if (df->function) { |
| 237 | df->functions_list = parse_functions_list(df->function); | 244 | df->functions_list = parse_functions_list(df->function); |
| 238 | } | 245 | } |
