[sr-dev] git:3.2: Proper parsing for PVs

Ovidiu Sas osas at voipembedded.com
Wed Feb 8 13:45:01 CET 2012


Module: sip-router
Branch: 3.2
Commit: 5fc59c44a6dbc97049a985b5b2f7280510b293b0
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5fc59c44a6dbc97049a985b5b2f7280510b293b0

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date:   Tue Feb  7 19:12:36 2012 -0500

Proper parsing for PVs
Closes FS#202
 - sr.pv.get fails for retrieving index header variable in Lua
(cherry picked from commit 8b9a98e8a8205b2214bf3503afea8aece20e2396)

---

 pvapi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pvapi.c b/pvapi.c
index 940f017..d1ebfe6 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -125,7 +125,7 @@ int pv_locate_name(str *in)
 	{
 		/* name with parenthesis: $(...) */
 		pcount = 1;
-		for(i=1; i<in->len; i++)
+		for(i=2; i<in->len; i++)
 		{
 			if(in->s[i]==PV_LNBRACKET)
 				pcount++;
@@ -135,6 +135,7 @@ int pv_locate_name(str *in)
 				return i+1;
 		}
 		/* non-closing name parenthesis */
+		LM_ERR("non-closing name parenthesis [%.*s]\n",in->len,in->s);
 		return -1;
 	}
 
@@ -167,6 +168,7 @@ int pv_locate_name(str *in)
 			return i+1;
 	}
 	/* non-closing inner-name parenthesis */
+	LM_ERR("non-closing inner-name parenthesis [%.*s]\n",in->len,in->s);
 	return -1;
 }
 




More information about the sr-dev mailing list