summaryrefslogtreecommitdiffstats
path: root/src/expressions.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-28 21:27:00 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-28 21:27:00 +0400
commit922b62c8c3c59a287729726234b1b507da333a33 (patch)
tree5035ab823420a825e92b85a409860e58e1e04c77 /src/expressions.c
parent1b106b62bc140af89e14cb91b10f7978a47932fc (diff)
downloadrspamd-922b62c8c3c59a287729726234b1b507da333a33.tar.gz
rspamd-922b62c8c3c59a287729726234b1b507da333a33.zip
* Fix error with writing symbols cache file
* Fix error while working in utf mode when raw regexps was not created properly
Diffstat (limited to 'src/expressions.c')
-rw-r--r--src/expressions.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/expressions.c b/src/expressions.c
index 224b65032..0d61f9ca2 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -705,6 +705,13 @@ parse_regexp (memory_pool_t * pool, char *line, gboolean raw_mode)
}
}
result->regexp = g_regex_new (begin, regexp_flags, 0, &err);
+ if ((regexp_flags & G_REGEX_RAW) != 0) {
+ result->raw_regexp = result->regexp;
+ }
+ else {
+ result->raw_regexp = g_regex_new (begin, regexp_flags | G_REGEX_RAW, 0, &err);
+ memory_pool_add_destructor (pool, (pool_destruct_func) g_regex_unref, (void *)result->raw_regexp);
+ }
*end = '/';
result->regexp_text = memory_pool_strdup (pool, start);
memory_pool_add_destructor (pool, (pool_destruct_func) g_regex_unref, (void *)result->regexp);
@@ -714,14 +721,7 @@ parse_regexp (memory_pool_t * pool, char *line, gboolean raw_mode)
msg_warn ("could not read regexp: %s while reading regexp %s", err->message, src);
return NULL;
}
- if ((regexp_flags & G_REGEX_RAW) != 0) {
- result->raw_regexp = result->regexp;
- }
- else {
- result->raw_regexp = g_regex_new (begin, regexp_flags | G_REGEX_RAW, 0, &err);
- memory_pool_add_destructor (pool, (pool_destruct_func) g_regex_unref, (void *)result->raw_regexp);
- }
- *end = '/';
+
if (result->raw_regexp == NULL || err != NULL) {
msg_warn ("could not read raw regexp: %s while reading regexp %s", err->message, src);