[asterisk-commits] murf: trunk r83590 - in /trunk: ./ res/ael/pval.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Sep 22 14:54:11 CDT 2007
Author: murf
Date: Sat Sep 22 14:54:10 2007
New Revision: 83590
URL: http://svn.digium.com/view/asterisk?view=rev&rev=83590
Log:
Merged revisions 83589 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r83589 | murf | 2007-09-22 13:39:16 -0600 (Sat, 22 Sep 2007) | 1 line
This closes issue #10788 -- The exact same fixes are made here for the first arg in the for(arg1; arg2; arg3) {} statement, as were done for the 3rd arg. It can now be an assignment that will embedded in a Set() app, or a macro call, or an app call.
........
Modified:
trunk/ (props changed)
trunk/res/ael/pval.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/res/ael/pval.c
URL: http://svn.digium.com/view/asterisk/trunk/res/ael/pval.c?view=diff&rev=83590&r1=83589&r2=83590
==============================================================================
--- trunk/res/ael/pval.c (original)
+++ trunk/res/ael/pval.c Sat Sep 22 14:54:10 2007
@@ -3137,16 +3137,51 @@
strcpy(buf2,p->u1.for_init);
remove_spaces_before_equals(buf2);
strp = strchr(buf2, '=');
- strp2 = strchr(p->u1.for_init, '=');
if (strp) {
+ strp2 = strchr(p->u1.for_init, '=');
*(strp+1) = 0;
strcat(buf2,"$[");
strncat(buf2,strp2+1, sizeof(buf2)-strlen(strp2+1)-2);
strcat(buf2,"]");
for_init->appargs = strdup(buf2);
- } else
- for_init->appargs = strdup(p->u1.for_init);
-
+ for_init->app = strdup("Set");
+ } else {
+ strp2 = p->u1.for_init;
+ while (*strp2 && isspace(*strp2))
+ strp2++;
+ if (*strp2 == '&') { /* itsa macro call */
+ char *strp3 = strp2+1;
+ while (*strp3 && isspace(*strp3))
+ strp3++;
+ strcpy(buf2, strp3);
+ strp3 = strchr(buf2,'(');
+ if (strp3) {
+ *strp3 = '|';
+ }
+ while ((strp3=strchr(buf2,','))) {
+ *strp3 = '|';
+ }
+ strp3 = strrchr(buf2, ')');
+ if (strp3)
+ *strp3 = 0; /* remove the closing paren */
+
+ for_init->appargs = strdup(buf2);
+
+ for_init->app = strdup("Macro");
+ } else { /* must be a regular app call */
+ char *strp3;
+ strcpy(buf2, strp2);
+ strp3 = strchr(buf2,'(');
+ if (strp3) {
+ *strp3 = 0;
+ for_init->app = strdup(buf2);
+ for_init->appargs = strdup(strp3+1);
+ strp3 = strrchr(for_init->appargs, ')');
+ if (strp3)
+ *strp3 = 0; /* remove the closing paren */
+ }
+ }
+ }
strcpy(buf2,p->u3.for_inc);
remove_spaces_before_equals(buf2);
More information about the asterisk-commits
mailing list