diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-28 19:42:04 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-28 19:42:04 +0400 |
commit | e0fac6fb14601522faf67071d2a163dfa38563a2 (patch) | |
tree | 20d7a50ce322d5027c7b59066d3d82b29bc71094 /src/expressions.c | |
parent | 111a26e20eb95ea3305c8cb761b0286f4d5098e1 (diff) | |
download | rspamd-e0fac6fb14601522faf67071d2a163dfa38563a2.tar.gz rspamd-e0fac6fb14601522faf67071d2a163dfa38563a2.zip |
* Another try to save regexps in cache correctly
* Improve test logs for regexps
Diffstat (limited to 'src/expressions.c')
-rw-r--r-- | src/expressions.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expressions.c b/src/expressions.c index 9b8abc429..224b65032 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -546,7 +546,7 @@ parse_expression (memory_pool_t * pool, char *line) struct rspamd_regexp * parse_regexp (memory_pool_t * pool, char *line, gboolean raw_mode) { - char *begin, *end, *p, *src; + char *begin, *end, *p, *src, *start; struct rspamd_regexp *result, *check; int regexp_flags = G_REGEX_OPTIMIZE | G_REGEX_NO_AUTO_CAPTURE; GError *err = NULL; @@ -561,6 +561,7 @@ parse_regexp (memory_pool_t * pool, char *line, gboolean raw_mode) msg_warn ("got empty regexp"); return NULL; } + start = line; /* First try to find header name */ begin = strchr (line, '/'); if (begin != NULL) { @@ -705,7 +706,7 @@ parse_regexp (memory_pool_t * pool, char *line, gboolean raw_mode) } result->regexp = g_regex_new (begin, regexp_flags, 0, &err); *end = '/'; - result->regexp_text = memory_pool_strdup (pool, line); + result->regexp_text = memory_pool_strdup (pool, start); memory_pool_add_destructor (pool, (pool_destruct_func) g_regex_unref, (void *)result->regexp); if (result->regexp == NULL || err != NULL) { |