[asterisk-commits] tilghman: trunk r87811 - /trunk/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 31 10:46:42 CDT 2007


Author: tilghman
Date: Wed Oct 31 10:46:41 2007
New Revision: 87811

URL: http://svn.digium.com/view/asterisk?view=rev&rev=87811
Log:
Optimize pbx_substitute_variables

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=87811&r1=87810&r2=87811
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Oct 31 10:46:41 2007
@@ -1819,10 +1819,15 @@
 
 static void pbx_substitute_variables(char *passdata, int datalen, struct ast_channel *c, struct ast_exten *e)
 {
+	const char *tmp;
 	memset(passdata, 0, datalen);
 
+	/* Nothing more to do */
+	if (!e->data)
+		return;
+
 	/* No variables or expressions in e->data, so why scan it? */
-	if (e->data && !strchr(e->data, '$') && !strstr(e->data,"${") && !strstr(e->data,"$[") && !strstr(e->data,"$(")) {
+	if ((!(tmp = strchr(e->data, '$'))) || (!strstr(tmp, "${") && !strstr(tmp, "$["))) {
 		ast_copy_string(passdata, e->data, datalen);
 		return;
 	}




More information about the asterisk-commits mailing list