aboutsummaryrefslogtreecommitdiffstats
path: root/src/expressions.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-04-23 19:42:34 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-04-23 19:42:34 +0400
commit4806dfcd8b6d6e758a9e005cbf10d8ed36d09a90 (patch)
tree5ad07642152a981bf513f090ceca320f3766cc16 /src/expressions.c
parentd3c91b53ed3ef7c5aecdf09954cb7d92f84cbeec (diff)
downloadrspamd-4806dfcd8b6d6e758a9e005cbf10d8ed36d09a90.tar.gz
rspamd-4806dfcd8b6d6e758a9e005cbf10d8ed36d09a90.zip
* Some more bugs are (hopefuly) fixed
Diffstat (limited to 'src/expressions.c')
-rw-r--r--src/expressions.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/expressions.c b/src/expressions.c
index cc5e09072..0ad9f1a72 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -210,6 +210,7 @@ is_regexp_flag (char a)
case 's':
case 'u':
case 'o':
+ case 'r':
case 'H':
case 'M':
case 'P':
@@ -297,6 +298,8 @@ parse_expression (memory_pool_t *pool, char *line)
if (line == NULL || pool == NULL) {
return NULL;
}
+
+ msg_debug ("parse_expression: parsing expression {{ %s }}", line);
function_stack = g_queue_new ();
p = line;
@@ -379,13 +382,13 @@ parse_expression (memory_pool_t *pool, char *line)
case READ_REGEXP_FLAGS:
if (!is_regexp_flag (*p) || *(p + 1) == '\0') {
if (c != p) {
- /* Copy operand */
- if (*(p + 1) == '\0' || *(p - 1) == '/') {
- p++;
+ if (is_regexp_flag (*p) && *(p + 1) == '\0') {
+ p ++;
}
- str = memory_pool_alloc (pool, p - c + 1);
- g_strlcpy (str, c - 1, (p - c + 1));
+ str = memory_pool_alloc (pool, p - c + 2);
+ g_strlcpy (str, c - 1, (p - c + 2));
g_strstrip (str);
+ msg_debug ("parse_expression: found regexp: %s", str);
if (strlen (str) > 0) {
insert_expression (pool, &expr, EXPR_REGEXP, 0, str);
}