]> source.dussan.org Git - rspamd.git/commitdiff
* Fix parsing regexp with '=' symbol inside
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 27 Mar 2009 13:13:16 +0000 (16:13 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 27 Mar 2009 13:13:16 +0000 (16:13 +0300)
* Fix config file syntax checking

src/expressions.c
src/plugins/surbl.c

index 683e13dd8589d3bcdb1b0d36786e0b878ff455c5..c1cd8c0bdfec56f1cd3e4bf18ed1896aea683d09 100644 (file)
@@ -458,8 +458,20 @@ 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;
@@ -467,7 +479,7 @@ parse_regexp (memory_pool_t *pool, char *line)
                line = begin;
        }
        /* Find begin of regexp */
-       while (*line != '/') {
+       while (*line && *line != '/') {
                line ++;
        }
        if (*line != '\0') {
index 0fe64ba2fa09f13ac26feddfd2a242dfb496b324..aacc7120b0dfec76613f8d1995554d6b8e2a5eee 100644 (file)
@@ -222,7 +222,7 @@ surbl_module_config (struct config_file *cfg)
                surbl_module_ctx->suffixes = g_list_prepend (surbl_module_ctx->suffixes, new_suffix);
        }
 
-       return 0;
+       return TRUE;
 }
 
 int