From 31fbdff1d7b5ada9720a7aa7bac808799532ede6 Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 11 Oct 2005 20:52:37 +0000 Subject: allow semicolons to be escaped in call files (issue #5407) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6742 f38db490-d61c-443f-a65b-d21fe96a405b --- pbx/pbx_spool.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'pbx') diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index a3c8cdac6..bcb780deb 100755 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -129,9 +129,17 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) else c++; } - c = strchr(buf, ';'); - if (c) - *c = '\0'; + + c = buf; + while ((c = strchr(c, ';'))) { + if ((c > buf) && (c[-1] == '\\')) { + memmove(c - 1, c, strlen(c) + 1); + c++; + } else { + *c = '\0'; + break; + } + } /* Trim trailing white space */ while(!ast_strlen_zero(buf) && buf[strlen(buf) - 1] < 33) -- cgit v1.2.3