diff options
| author | simon MAGNIN-FEYSOT | 2018-01-17 19:25:08 +0100 |
|---|---|---|
| committer | jvoisin | 2018-01-17 19:25:08 +0100 |
| commit | b213c8e08b5624da9bb69dd05e132e247bab3082 (patch) | |
| tree | 70098ca8ea967138d4beb3a1f423e5beb2908fd3 /src/sp_config_keywords.c | |
| parent | 05e4b7ea67e07bb82db2a37930b383d51500b341 (diff) | |
Remove useless "head" member in our linked lists implementation
This should close #85
Diffstat (limited to 'src/sp_config_keywords.c')
| -rw-r--r-- | src/sp_config_keywords.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 135868b..93c3da9 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -102,7 +102,7 @@ int parse_global(char *line) { | |||
| 102 | return parse_keywords(sp_config_funcs_global, line); | 102 | return parse_keywords(sp_config_funcs_global, line); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | static int parse_eval_filter_conf(char *line, sp_list_node *list) { | 105 | static int parse_eval_filter_conf(char *line, sp_list_node **list) { |
| 106 | char *token; | 106 | char *token; |
| 107 | char *rest; | 107 | char *rest; |
| 108 | sp_config_functions sp_config_funcs[] = { | 108 | sp_config_functions sp_config_funcs[] = { |
| @@ -116,19 +116,19 @@ static int parse_eval_filter_conf(char *line, sp_list_node *list) { | |||
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | while ((token = strtok_r(rest, ",", &rest))) { | 118 | while ((token = strtok_r(rest, ",", &rest))) { |
| 119 | sp_list_insert(list, token); | 119 | *list = sp_list_insert(*list, token); |
| 120 | } | 120 | } |
| 121 | return SUCCESS; | 121 | return SUCCESS; |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | int parse_eval_blacklist(char *line) { | 124 | int parse_eval_blacklist(char *line) { |
| 125 | return parse_eval_filter_conf(line, | 125 | return parse_eval_filter_conf(line, |
| 126 | SNUFFLEUPAGUS_G(config).config_eval->blacklist); | 126 | &SNUFFLEUPAGUS_G(config).config_eval->blacklist); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | int parse_eval_whitelist(char *line) { | 129 | int parse_eval_whitelist(char *line) { |
| 130 | return parse_eval_filter_conf(line, | 130 | return parse_eval_filter_conf(line, |
| 131 | SNUFFLEUPAGUS_G(config).config_eval->whitelist); | 131 | &SNUFFLEUPAGUS_G(config).config_eval->whitelist); |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | int parse_cookie(char *line) { | 134 | int parse_cookie(char *line) { |
| @@ -204,7 +204,8 @@ int parse_cookie(char *line) { | |||
| 204 | return -1; | 204 | return -1; |
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | sp_list_insert(SNUFFLEUPAGUS_G(config).config_cookie->cookies, cookie); | 207 | SNUFFLEUPAGUS_G(config).config_cookie->cookies = sp_list_insert( |
| 208 | SNUFFLEUPAGUS_G(config).config_cookie->cookies, cookie); | ||
| 208 | return SUCCESS; | 209 | return SUCCESS; |
| 209 | } | 210 | } |
| 210 | 211 | ||
| @@ -371,12 +372,12 @@ int parse_disabled_functions(char *line) { | |||
| 371 | 372 | ||
| 372 | switch (get_construct_type(df)) { | 373 | switch (get_construct_type(df)) { |
| 373 | case ZEND_INCLUDE_OR_EVAL: | 374 | case ZEND_INCLUDE_OR_EVAL: |
| 374 | sp_list_insert( | 375 | SNUFFLEUPAGUS_G(config).config_disabled_constructs->construct_include = sp_list_insert( |
| 375 | SNUFFLEUPAGUS_G(config).config_disabled_constructs->construct_include, | 376 | SNUFFLEUPAGUS_G(config).config_disabled_constructs->construct_include, |
| 376 | df); | 377 | df); |
| 377 | return ret; | 378 | return ret; |
| 378 | case ZEND_EVAL_CODE: | 379 | case ZEND_EVAL_CODE: |
| 379 | sp_list_insert( | 380 | SNUFFLEUPAGUS_G(config).config_disabled_constructs->construct_eval = sp_list_insert( |
| 380 | SNUFFLEUPAGUS_G(config).config_disabled_constructs->construct_eval, | 381 | SNUFFLEUPAGUS_G(config).config_disabled_constructs->construct_eval, |
| 381 | df); | 382 | df); |
| 382 | return ret; | 383 | return ret; |
| @@ -390,11 +391,11 @@ int parse_disabled_functions(char *line) { | |||
| 390 | } | 391 | } |
| 391 | 392 | ||
| 392 | if (df->ret || df->r_ret || df->ret_type) { | 393 | if (df->ret || df->r_ret || df->ret_type) { |
| 393 | sp_list_insert(SNUFFLEUPAGUS_G(config) | 394 | SNUFFLEUPAGUS_G(config).config_disabled_functions_ret->disabled_functions = sp_list_insert( |
| 394 | .config_disabled_functions_ret->disabled_functions, | 395 | SNUFFLEUPAGUS_G(config).config_disabled_functions_ret->disabled_functions, |
| 395 | df); | 396 | df); |
| 396 | } else { | 397 | } else { |
| 397 | sp_list_insert( | 398 | SNUFFLEUPAGUS_G(config).config_disabled_functions->disabled_functions = sp_list_insert( |
| 398 | SNUFFLEUPAGUS_G(config).config_disabled_functions->disabled_functions, | 399 | SNUFFLEUPAGUS_G(config).config_disabled_functions->disabled_functions, |
| 399 | df); | 400 | df); |
| 400 | } | 401 | } |
