summaryrefslogtreecommitdiff
path: root/pbx/pbx_ael.c
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2006-12-30 00:51:07 +0000
committerSteve Murphy <murf@digium.com>2006-12-30 00:51:07 +0000
commitb96a97e315001358e409c4a0a125cea8116c2ccf (patch)
treef925f1eb33b0a3923fe38ee07555936c41b83a5f /pbx/pbx_ael.c
parent1f8001e8161ad43b9be1222a23cd10463f6c40f5 (diff)
Merged revisions 49061 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r49061 | murf | 2006-12-29 17:40:37 -0700 (Fri, 29 Dec 2006) | 1 line A fix for 8661, where the CUT func needed to have comma args converted to vertical bars. I hope this change does little harm. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/pbx_ael.c')
-rw-r--r--pbx/pbx_ael.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c
index 7d65e5065..74c0b6d40 100644
--- a/pbx/pbx_ael.c
+++ b/pbx/pbx_ael.c
@@ -149,6 +149,20 @@ static void fix_gotos_in_extensions(struct ael_extension *exten);
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: ============================================================================= */
@@ -208,7 +222,7 @@ static void print_pval(FILE *fin, pval *item, int depth)
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");
@@ -3396,6 +3410,7 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement,
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);