Author: anthm Date: Tue Jan 22 09:16:45 2008 New Revision: 7317 Modified: freeswitch/trunk/src/switch_utils.c Log: update Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Tue Jan 22 09:16:45 2008 @@ -1039,7 +1039,7 @@ /* Helper function used when separating strings to remove quotes, leading / trailing spaces, and to convert escaped characters. */ -static char *cleanup_separated_string(char *str) +static char *cleanup_separated_string(char *str, char delim) { char *ptr; char *dest; @@ -1057,7 +1057,7 @@ if (*ptr == ESCAPE_META) { e = *(ptr+1); - if (e == '\'' || e == '"' || (e = unescape_char(*(ptr+1))) != *(ptr+1)) { + if (e == '\'' || e == '"' || (delim && e == delim) || (e = unescape_char(*(ptr+1))) != *(ptr+1)) { ++ptr; *dest++ = e; end = dest; @@ -1117,7 +1117,7 @@ } /* strip quotes, escaped chars and leading / trailing spaces */ for (i = 0; i < count; ++i) { - array[i] = cleanup_separated_string(array[i]); + array[i] = cleanup_separated_string(array[i], delim); } return count; } @@ -1175,7 +1175,7 @@ } /* strip quotes, escaped chars and leading / trailing spaces */ for (i = 0; i < count; ++i) { - array[i] = cleanup_separated_string(array[i]); + array[i] = cleanup_separated_string(array[i], 0); } return count; }