[sr-dev] git:sr_3.0: core: kamailio mode config parser fix

Andrei Pelinescu-Onciul andrei at iptel.org
Mon Nov 2 15:37:47 CET 2009


Module: sip-router
Branch: sr_3.0
Commit: 796ee85ed4da89886a676133e97c127ee8fb129f
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=796ee85ed4da89886a676133e97c127ee8fb129f

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Mon Nov  2 15:35:42 2009 +0100

core: kamailio mode config parser fix

- fixed bug in parsing pvars without (), when in #!KAMAILIO mode

Reported-by: Daniel-Constantin Mierla <miconda at gmail.com>

---

 cfg.lex |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cfg.lex b/cfg.lex
index 105df4b..61e694e 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -962,10 +962,16 @@ EAT_ABLE	[\ \t\b\r]
 <PVAR_P>{LPAREN}			{ p_nest++; yymore(); }
 <PVAR_P>.					{ yymore(); }
 
-<PVARID>{ID}|'.'			{yymore(); }
+<PVARID>{ID}|'\.'			{yymore(); }
 <PVARID>{LPAREN}			{	state = PVAR_P_S; BEGIN(PVAR_P);
 								p_nest=1; yymore(); }
-<PVARID>.					{ yyless(0); state=INITIAL_S; BEGIN(INITIAL);
+<PVARID>.					{	yyless(yyleng-1);
+								count();
+								addstr(&s_buf, yytext, yyleng);
+								yylval.strval=s_buf.s;
+								memset(&s_buf, 0, sizeof(s_buf));
+								state=INITIAL_S;
+								BEGIN(INITIAL);
 								return PVAR;
 							}
 




More information about the sr-dev mailing list