[asterisk-commits] murf: branch 1.4 r134652 - /branches/1.4/pbx/pbx_ael.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 30 17:02:07 CDT 2008


Author: murf
Date: Wed Jul 30 17:02:07 2008
New Revision: 134652

URL: http://svn.digium.com/view/asterisk?view=rev&rev=134652
Log:
(closes issue #13197)
Reported by: pj

(closes issue #13051)
Reported by: pj

This patch substitutes commas in the expr 
supplied to the if () statement, as in
if ( expr ) ...

This solves both the bugs above, and makes
the source symmetric with switch statements,
which were earlier reported to need this sort
of treatment.

I tested this using the examples, both for
the compiler and at run time. Looks good.


Modified:
    branches/1.4/pbx/pbx_ael.c

Modified: branches/1.4/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_ael.c?view=diff&rev=134652&r1=134651&r2=134652
==============================================================================
--- branches/1.4/pbx/pbx_ael.c (original)
+++ branches/1.4/pbx/pbx_ael.c Wed Jul 30 17:02:07 2008
@@ -3641,8 +3641,13 @@
 			if_end->type = AEL_APPCALL;
 			if ( p->type == PV_RANDOM )
 				snprintf(buf1,sizeof(buf1),"$[${RAND(0|99)} < (%s)]",p->u1.str);
-			else
-				snprintf(buf1,sizeof(buf1),"$[%s]",p->u1.str);
+			else {
+				char buf[8000];
+				strcpy(buf,p->u1.str);
+				substitute_commas(buf);
+				snprintf(buf1,sizeof(buf1),"$[%s]",buf);
+			}
+			
 			if_test->app = 0;
 			if_test->appargs = strdup(buf1);
 			snprintf(buf1,sizeof(buf1),"Finish if-%s-%d", label, control_statement_count);




More information about the asterisk-commits mailing list