From 14f0ebf3b52a613302178ff777b2fbea6401c3fa Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 21 Jan 2010 19:59:28 +0000 Subject: [PATCH] allow double escape in parser for \ git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16440 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_utils.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index 4b1524f5af..5bc915302c 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -1571,6 +1571,9 @@ static char unescape_char(char escaped) case 's': unescaped = ' '; break; + case '\\': + unescaped = 1; /* 1 means double esc */ + break; default: unescaped = escaped; } @@ -1644,7 +1647,11 @@ static char *cleanup_separated_string(char *str, char delim) e = *(ptr + 1); if (e == '\'' || e == '"' || (delim && e == delim) || (e = unescape_char(*(ptr + 1))) != *(ptr + 1)) { ++ptr; - *dest++ = e; + if (e == 1) { + *dest++ = '\\'; + } else { + *dest++ = e; + } end = dest; esc++; }