fix escape handling in quotes! :)

SVN revision: 24641
This commit is contained in:
Carsten Haitzler 2006-08-13 10:37:04 +00:00
parent 86ba91031a
commit fb4772a769
1 changed files with 11 additions and 6 deletions

View File

@ -339,12 +339,11 @@ next_token(char *p, char *end, char **new_p, int *delim)
while (*p)
{
if (*p == '"')
memmove(p, p + 1, strlen(p));
else if ((*p == '\\') && (*(p + 1) == '"'))
memmove(p, p + 1, strlen(p));
else if ((*p == '\\') && (*(p + 1) == '\\'))
memmove(p, p + 1, strlen(p));
if ((*p == '\"') &&
((p == tok) || ((p > tok) && (*(p - 1) != '\\'))))
{
memmove(p, p + 1, strlen(p));
}
else if ((*p == '\\') && (*(p + 1) == 'n'))
{
memmove(p, p + 1, strlen(p));
@ -355,6 +354,12 @@ next_token(char *p, char *end, char **new_p, int *delim)
memmove(p, p + 1, strlen(p));
*p = '\t';
}
else if (*p == '\\')
{
memmove(p, p + 1, strlen(p));
p++;
if (*p == '\\') p++;
}
else
p++;
}