From 2f2642851746b0985f67e8dde58e2458eae07cca Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 25 Mar 2010 19:19:47 +0300 Subject: * Initial add of xml parser for rspamd configuration --- src/cfg_file.l | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/cfg_file.l') diff --git a/src/cfg_file.l b/src/cfg_file.l index 48cf18c44..fd83be66c 100644 --- a/src/cfg_file.l +++ b/src/cfg_file.l @@ -130,6 +130,14 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG; [ \t]* /* eat the whitespace */ [^ \t\n]+ { /* got the include file name */ /* got the include file name */ + /* Handle XML case */ + int len = strlen (yytext); + if (strcmp (yytext + len - 4, ".xml") == 0) { + if (!read_xml_config (cfg, yytext)) { + yyerror ("invalid xml detected"); + } + BEGIN(INITIAL); + } if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) { yyerror ("yylex: includes nested too deeply" ); return -1; -- cgit v1.2.3