update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7301 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
798b257bdf
commit
6e1c32e099
|
@ -95,7 +95,7 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
|
|||
&erroffset, /* for error offset */
|
||||
NULL); /* use default character tables */
|
||||
if (error) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "COMPILE ERROR: %d [%s]\n", erroffset, error);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "COMPILE ERROR: %d [%s][%s]\n", erroffset, error, expression);
|
||||
switch_regex_safe_free(re);
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include "private/switch_core_pvt.h"
|
||||
|
||||
#define ESCAPE_META '\\'
|
||||
|
||||
SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char close)
|
||||
{
|
||||
|
@ -1017,7 +1017,7 @@ SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in,
|
|||
static char unescape_char(char escaped)
|
||||
{
|
||||
char unescaped;
|
||||
|
||||
printf("WTF [%c]\n", escaped);
|
||||
switch (escaped) {
|
||||
case 'n':
|
||||
unescaped = '\n';
|
||||
|
@ -1052,11 +1052,19 @@ static char *cleanup_separated_string(char *str)
|
|||
}
|
||||
|
||||
for (start = dest = ptr; *ptr; ++ptr) {
|
||||
if (*ptr == '\\') {
|
||||
char e;
|
||||
int esc = 0;
|
||||
|
||||
if (*ptr == ESCAPE_META) {
|
||||
if ((e = unescape_char(*(ptr+1))) != e) {
|
||||
++ptr;
|
||||
*dest++ = unescape_char(*ptr);
|
||||
*dest++ = e;
|
||||
end = dest;
|
||||
} else if (*ptr == '\'') {
|
||||
esc++;
|
||||
}
|
||||
}
|
||||
if (!esc) {
|
||||
if (*ptr == '\'') {
|
||||
inside_quotes = (1 - inside_quotes);
|
||||
} else {
|
||||
*dest++ = *ptr;
|
||||
|
@ -1065,6 +1073,7 @@ static char *cleanup_separated_string(char *str)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (end) {
|
||||
*end = '\0';
|
||||
}
|
||||
|
@ -1093,7 +1102,7 @@ static unsigned int separate_string_char_delim(char *buf, char delim, char **arr
|
|||
|
||||
case FIND_DELIM:
|
||||
/* escaped characters are copied verbatim to the destination string */
|
||||
if (*ptr == '\\') {
|
||||
if (*ptr == ESCAPE_META) {
|
||||
++ptr;
|
||||
} else if (*ptr == '\'') {
|
||||
inside_quotes = (1 - inside_quotes);
|
||||
|
@ -1143,7 +1152,7 @@ static unsigned int separate_string_blank_delim(char *buf, char **array, unsigne
|
|||
break;
|
||||
|
||||
case FIND_DELIM:
|
||||
if (*ptr == '\\') {
|
||||
if (*ptr == ESCAPE_META) {
|
||||
++ptr;
|
||||
} else if (*ptr == '\'') {
|
||||
inside_quotes = (1 - inside_quotes);
|
||||
|
|
Loading…
Reference in New Issue