From 7408d6fd0fc4652ffbc0fa8b13cabf455f8ed0c1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 31 Mar 2009 12:58:38 +0400 Subject: [PATCH] * Fix error in regexp processing --- src/cfg_file.l | 2 +- src/cfg_file.y | 7 ++++++- src/plugins/regexp.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cfg_file.l b/src/cfg_file.l index 8d347409f..d0efa5c2f 100644 --- a/src/cfg_file.l +++ b/src/cfg_file.l @@ -161,7 +161,7 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG; [ \t]+ /* ignore whitespace */; [ \t]*#.* /* ignore comments */; ^.endlua$ BEGIN(INITIAL); -.* add_luabuf(yytext); +.* add_luabuf(yytext); return LUACODE; %% /* diff --git a/src/cfg_file.y b/src/cfg_file.y index 92b695d55..8517878ae 100644 --- a/src/cfg_file.y +++ b/src/cfg_file.y @@ -48,7 +48,7 @@ struct statfile_section *cur_section = NULL; %token LOGGING LOG_TYPE LOG_TYPE_CONSOLE LOG_TYPE_SYSLOG LOG_TYPE_FILE %token LOG_LEVEL LOG_LEVEL_DEBUG LOG_LEVEL_INFO LOG_LEVEL_WARNING LOG_LEVEL_ERROR LOG_FACILITY LOG_FILENAME %token STATFILE ALIAS PATTERN WEIGHT STATFILE_POOL_SIZE SIZE TOKENIZER CLASSIFIER -%token DELIVERY LMTP ENABLED AGENT SECTION +%token DELIVERY LMTP ENABLED AGENT SECTION LUACODE %type STRING %type VARIABLE @@ -92,6 +92,7 @@ command : | statfile_pool_size | lmtp | delivery + | luacode ; tempdir : @@ -830,6 +831,10 @@ deliveryagent: } ; +luacode: + LUACODE + ; + %% /* * vi:ts=4 diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 3b3328f3e..6f6efd4be 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -423,7 +423,7 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args) } res += process_regexp (re, task); } - cur = g_list_next (args); + cur = g_list_next (cur); } return res >= param_count; -- 2.39.5