update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7317 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
9a2c67d7b1
commit
475b98f444
|
@ -1039,7 +1039,7 @@ static char unescape_char(char escaped)
|
||||||
|
|
||||||
/* Helper function used when separating strings to remove quotes, leading /
|
/* Helper function used when separating strings to remove quotes, leading /
|
||||||
trailing spaces, and to convert escaped characters. */
|
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 *ptr;
|
||||||
char *dest;
|
char *dest;
|
||||||
|
@ -1057,7 +1057,7 @@ static char *cleanup_separated_string(char *str)
|
||||||
|
|
||||||
if (*ptr == ESCAPE_META) {
|
if (*ptr == ESCAPE_META) {
|
||||||
e = *(ptr+1);
|
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;
|
++ptr;
|
||||||
*dest++ = e;
|
*dest++ = e;
|
||||||
end = dest;
|
end = dest;
|
||||||
|
@ -1117,7 +1117,7 @@ static unsigned int separate_string_char_delim(char *buf, char delim, char **arr
|
||||||
}
|
}
|
||||||
/* strip quotes, escaped chars and leading / trailing spaces */
|
/* strip quotes, escaped chars and leading / trailing spaces */
|
||||||
for (i = 0; i < count; ++i) {
|
for (i = 0; i < count; ++i) {
|
||||||
array[i] = cleanup_separated_string(array[i]);
|
array[i] = cleanup_separated_string(array[i], delim);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
@ -1175,7 +1175,7 @@ static unsigned int separate_string_blank_delim(char *buf, char **array, unsigne
|
||||||
}
|
}
|
||||||
/* strip quotes, escaped chars and leading / trailing spaces */
|
/* strip quotes, escaped chars and leading / trailing spaces */
|
||||||
for (i = 0; i < count; ++i) {
|
for (i = 0; i < count; ++i) {
|
||||||
array[i] = cleanup_separated_string(array[i]);
|
array[i] = cleanup_separated_string(array[i], 0);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue