From: Vsevolod Stakhov Date: Tue, 31 Mar 2009 09:29:11 +0000 (+0400) Subject: * Fix order of functions arguments X-Git-Tag: 0.2.7~206 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=625a7e5e69cf5a7ac85b6a7bc59907a54682765d;p=rspamd.git * Fix order of functions arguments * Do not try to check non-regexp expressions --- 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);