[Asterisk-cvs] asterisk pbx.c,1.285,1.286

markster markster
Tue Oct 18 13:48:49 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv7052

Modified Files:
	pbx.c 
Log Message:
Be sure to not consider prefix on variable updates (bug #5444)


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -d -r1.285 -r1.286
--- pbx.c	18 Oct 2005 16:51:28 -0000	1.285
+++ pbx.c	18 Oct 2005 17:42:42 -0000	1.286
@@ -5885,15 +5885,22 @@
 {
 	struct ast_var_t *newvariable;
 	struct varshead *headp;
-
+	const char *nametail = name;
 
 	if (name[strlen(name)-1] == ')')
 		return ast_func_write(chan, name, value);
 
 	headp = (chan) ? &chan->varshead : &globals;
 
+	/* For comparison purposes, we have to strip leading underscores */
+	if (*nametail == '_') {
+		nametail++;
+		if (*nametail == '_') 
+			nametail++;
+	}
+
 	AST_LIST_TRAVERSE (headp, newvariable, entries) {
-		if (strcasecmp(ast_var_name(newvariable), name) == 0) {
+		if (strcasecmp(ast_var_name(newvariable), nametail) == 0) {
 			/* there is already such a variable, delete it */
 			AST_LIST_REMOVE(headp, newvariable, entries);
 			ast_var_delete(newvariable);




More information about the svn-commits mailing list