[asterisk-commits] tilghman: trunk r53076 - in /trunk: ./ funcs/func_strings.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 1 13:12:57 MST 2007


Author: tilghman
Date: Thu Feb  1 14:12:56 2007
New Revision: 53076

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53076
Log:
Merged revisions 53075 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53075 | tilghman | 2007-02-01 14:09:52 -0600 (Thu, 01 Feb 2007) | 10 lines

Merged revisions 53074 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53074 | tilghman | 2007-02-01 14:07:35 -0600 (Thu, 01 Feb 2007) | 2 lines

Bug 8965

........

................

Modified:
    trunk/   (props changed)
    trunk/funcs/func_strings.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_strings.c?view=diff&rev=53076&r1=53075&r2=53076
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Thu Feb  1 14:12:56 2007
@@ -48,8 +48,7 @@
 static int function_fieldqty(struct ast_channel *chan, const char *cmd,
 			     char *parse, char *buf, size_t len)
 {
-	const char *varval;
-	char *varval2 = NULL;
+	char *varname, *varsubst, varval[8192] = "", *varval2 = varval;
 	int fieldcount = 0;
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(varname);
@@ -68,9 +67,10 @@
 			else
 				ast_copy_string(args.delim, "-", 2);
 		}
-		varval = pbx_builtin_getvar_helper(chan, args.varname);
-		if (varval)
-			varval2 = ast_strdupa(varval);
+		varsubst = alloca(strlen(varname) + 4);
+
+		sprintf(varsubst, "${%s}", varname);
+		pbx_substitute_variables_helper(chan, varsubst, varval, sizeof(varval) - 1);
 		while (strsep(&varval2, args.delim))
 			fieldcount++;
 	} else {



More information about the asterisk-commits mailing list