[Asterisk-cvs] asterisk pbx.c,1.287,1.288

markster markster
Tue Oct 18 15:22:20 CDT 2005


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

Modified Files:
	pbx.c 
Log Message:
The amazing disappearing and reappearing patch...  This time with documentation explaining it.


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -d -r1.287 -r1.288
--- pbx.c	18 Oct 2005 17:53:57 -0000	1.287
+++ pbx.c	18 Oct 2005 19:16:13 -0000	1.288
@@ -5885,14 +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