diff options
| author | jvoisin | 2018-02-05 17:27:45 +0100 |
|---|---|---|
| committer | GitHub | 2018-02-05 17:27:45 +0100 |
| commit | 4cbca117a3f2ef2d6695504970378ec4c483d19f (patch) | |
| tree | 2fe9d10ddf5fdff1c1c0f4cf0cf7cbb16d274e27 /src/sp_config.c | |
| parent | f0a956e825a83ff3a58d4714a92fbb945f6c8841 (diff) | |
Compatibility layer for pcre2
This should close #129
Diffstat (limited to 'src/sp_config.c')
| -rw-r--r-- | src/sp_config.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/sp_config.c b/src/sp_config.c index 7a38a45..1236ebd 100644 --- a/src/sp_config.c +++ b/src/sp_config.c | |||
| @@ -140,15 +140,9 @@ int parse_regexp(char *restrict line, char *restrict keyword, void *retval) { | |||
| 140 | char *value = get_param(&consumed, line, SP_TYPE_STR, keyword); | 140 | char *value = get_param(&consumed, line, SP_TYPE_STR, keyword); |
| 141 | 141 | ||
| 142 | if (value) { | 142 | if (value) { |
| 143 | const char *pcre_error; | 143 | sp_pcre *compiled_re = sp_pcre_compile(value); |
| 144 | int pcre_error_offset; | 144 | if (NULL != compiled_re) { |
| 145 | pcre *compiled_re = sp_pcre_compile(value, PCRE_CASELESS, &pcre_error, | 145 | *(sp_pcre **)retval = compiled_re; |
| 146 | &pcre_error_offset, NULL); | ||
| 147 | if (NULL == compiled_re) { | ||
| 148 | sp_log_err("config", "Failed to compile '%s': %s on line %zu.", value, | ||
| 149 | pcre_error, sp_line_no); | ||
| 150 | } else { | ||
| 151 | *(pcre **)retval = compiled_re; | ||
| 152 | return consumed; | 146 | return consumed; |
| 153 | } | 147 | } |
| 154 | } | 148 | } |
