[svn-commits] mnicholson: branch 1.8 r327512 - in /branches/1.8: main/ tests/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 11 08:54:03 CDT 2011


Author: mnicholson
Date: Mon Jul 11 08:53:59 2011
New Revision: 327512

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=327512
Log:
reset our buffer each iteration when doing variable substitution

Modified:
    branches/1.8/main/pbx.c
    branches/1.8/tests/test_substitution.c

Modified: branches/1.8/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/pbx.c?view=diff&rev=327512&r1=327511&r2=327512
==============================================================================
--- branches/1.8/main/pbx.c (original)
+++ branches/1.8/main/pbx.c Mon Jul 11 08:53:59 2011
@@ -3620,6 +3620,9 @@
 	ast_str_reset(*buf);
 	whereweare = tmp = templ;
 	while (!ast_strlen_zero(whereweare)) {
+		/* reset our buffer */
+		ast_str_reset(substr3);
+
 		/* Assume we're copying the whole remaining string */
 		pos = strlen(whereweare);
 		nextvar = NULL;

Modified: branches/1.8/tests/test_substitution.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/tests/test_substitution.c?view=diff&rev=327512&r1=327511&r2=327512
==============================================================================
--- branches/1.8/tests/test_substitution.c (original)
+++ branches/1.8/tests/test_substitution.c Mon Jul 11 08:53:59 2011
@@ -263,6 +263,7 @@
 	TEST(test_expected_result(test, c, "${LISTFILTER(list1,&,cd)}", "ab&ef"));
 	TEST(test_expected_result(test, c, "${SHELL(echo -n 123)},${SHELL(echo -n 456)}", "123,456"));
 	TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(echo -n 456)}", "123,,456"));
+	TEST(test_expected_result(test, c, "${foo},${this_does_not_exist},${THIS_DOES_NOT_EXIST(either)}", "123,,"));
 #undef TEST
 
 	/* For testing dialplan functions */




More information about the svn-commits mailing list