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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Dec 29 17:40:38 MST 2006


Author: murf
Date: Fri Dec 29 18:40:37 2006
New Revision: 49061

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49061
Log:
A fix for 8661, where the CUT func needed to have comma args converted to vertical bars. I hope this change does little harm.

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=49061&r1=49060&r2=49061
==============================================================================
--- branches/1.4/pbx/pbx_ael.c (original)
+++ branches/1.4/pbx/pbx_ael.c Fri Dec 29 18:40:37 2006
@@ -145,6 +145,20 @@
 static pval *get_extension_or_contxt(pval *p);
 static pval *get_contxt(pval *p);
 static void remove_spaces_before_equals(char *str);
+static void substitute_commas(char *str);
+
+/* I am adding this code to substitute commas with vertbars in the args to apps */
+static void substitute_commas(char *str)
+{
+	char *p = str;
+	while (p && *p)
+	{
+		if (*p == ',' && ((p != str && *(p-1) != '\\')
+				|| p == str))
+			*p = '|';
+		p++;
+	}
+}
 
 
 /* PRETTY PRINTER FOR AEL:  ============================================================================= */
@@ -204,7 +218,7 @@
 		fprintf(fin,"%s(", item->u1.str);
 		for (lp=item->u2.arglist; lp; lp=lp->next) {
 			if ( lp != item->u2.arglist )
-				fprintf(fin,", ");
+				fprintf(fin,",");
 			fprintf(fin,"%s", lp->u1.str);
 		}
 		fprintf(fin,");\n");
@@ -3244,6 +3258,7 @@
 			for (p2 = p->u2.arglist; p2; p2 = p2->next) {
 				if (p2 != p->u2.arglist )
 					strcat(buf1,"|");
+				substitute_commas(p2->u1.str);
 				strcat(buf1,p2->u1.str);
 			}
 			pr->app = strdup(p->u1.str);



More information about the asterisk-commits mailing list