aboutsummaryrefslogtreecommitdiffstats
path: root/src/expressions.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-27 16:13:16 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-27 16:13:16 +0300
commit7ca00ea032e4e53641640daa1682af21d1038a43 (patch)
tree43037d12cf374b914d775999e7cf9d00786a87a2 /src/expressions.c
parenta83e5f18a2b6d9dc3196045867bcd842cfea3323 (diff)
downloadrspamd-7ca00ea032e4e53641640daa1682af21d1038a43.tar.gz
rspamd-7ca00ea032e4e53641640daa1682af21d1038a43.zip
* Fix parsing regexp with '=' symbol inside
* Fix config file syntax checking
Diffstat (limited to 'src/expressions.c')
-rw-r--r--src/expressions.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/expressions.c b/src/expressions.c
index 683e13dd8..c1cd8c0bd 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -458,16 +458,28 @@ parse_regexp (memory_pool_t *pool, char *line)
return NULL;
}
/* First try to find header name */
- begin = strchr (line, '=');
+ begin = strchr (line, '/');
if (begin != NULL) {
*begin = '\0';
+ end = strchr (line, '=');
+ *begin = '/';
+ if (end) {
+ *end = '\0';
+ result->header = memory_pool_strdup (pool, line);
+ result->type = REGEXP_HEADER;
+ *end = '=';
+ line = end;
+ }
+ }
+ else {
+ *begin = '\0';
result->header = memory_pool_strdup (pool, line);
result->type = REGEXP_HEADER;
*begin = '=';
line = begin;
}
/* Find begin of regexp */
- while (*line != '/') {
+ while (*line && *line != '/') {
line ++;
}
if (*line != '\0') {