util: allow unbalanced double quote in EXTRACT_QUOTES|EXTRACT_RELAX mode

extract_first_word understands "\'string" but doesn't understand "\"string"
fixed this inconsistency.
This commit is contained in:
Evgeny Vereshchagin
2015-10-22 00:37:32 +00:00
parent 2dcc3c69a1
commit 9e44f56b4e
2 changed files with 10 additions and 2 deletions
+4 -2
View File
@@ -5913,9 +5913,11 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra
break;
case DOUBLE_QUOTE:
if (c == 0)
if (c == 0) {
if (flags & EXTRACT_RELAX)
goto finish_force_terminate;
return -EINVAL;
else if (c == '\"')
} else if (c == '\"')
state = VALUE;
else if (c == '\\')
state = DOUBLE_QUOTE_ESCAPE;