From 625a7e5e69cf5a7ac85b6a7bc59907a54682765d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 31 Mar 2009 13:29:11 +0400 Subject: [PATCH] * Fix order of functions arguments * Do not try to check non-regexp expressions --- src/expressions.c | 4 ++-- src/plugins/regexp.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/expressions.c b/src/expressions.c index c028d8476..e09b33ea1 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -402,12 +402,12 @@ parse_expression (memory_pool_t *pool, char *line) g_strstrip (str); arg->type = EXPRESSION_ARGUMENT_NORMAL; arg->data = str; - func->args = g_list_prepend (func->args, arg); + func->args = g_list_append (func->args, arg); } else { arg->type = EXPRESSION_ARGUMENT_FUNCTION; arg->data = old; - func->args = g_list_prepend (func->args, arg); + func->args = g_list_append (func->args, arg); } /* Pop function */ if (*p == ')') { diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 6f6efd4be..8dadffcf1 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -412,6 +412,11 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args) } else { param_pattern = (char *)arg->data; + if (*param_pattern != '/') { + /* Skip non-regexp arguments */ + cur = g_list_next (cur); + continue; + } /* This is regexp, so compile and create g_regexp object */ if ((re = re_cache_check (param_pattern)) == NULL) { re = parse_regexp (task->task_pool, param_pattern); -- 2.39.5