[asterisk-commits] mnicholson: trunk r327513 - in /trunk: ./ main/pbx.c tests/test_substitution.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 11 08:55:32 CDT 2011


Author: mnicholson
Date: Mon Jul 11 08:55:28 2011
New Revision: 327513

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=327513
Log:
Merged revisions 327512 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327512 | mnicholson | 2011-07-11 08:53:59 -0500 (Mon, 11 Jul 2011) | 2 lines
  
  reset our buffer each iteration when doing variable substitution
........

Modified:
    trunk/   (props changed)
    trunk/main/pbx.c
    trunk/tests/test_substitution.c

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

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=327513&r1=327512&r2=327513
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Mon Jul 11 08:55:28 2011
@@ -3732,6 +3732,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: trunk/tests/test_substitution.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_substitution.c?view=diff&rev=327513&r1=327512&r2=327513
==============================================================================
--- trunk/tests/test_substitution.c (original)
+++ trunk/tests/test_substitution.c Mon Jul 11 08:55:28 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 asterisk-commits mailing list