From 9e44f56b4ecfa47e27380165b834bd71aa403b78 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Thu, 22 Oct 2015 00:37:32 +0000 Subject: util: allow unbalanced double quote in EXTRACT_QUOTES|EXTRACT_RELAX mode extract_first_word understands "\'string" but doesn't understand "\"string" fixed this inconsistency. --- src/basic/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/basic') diff --git a/src/basic/util.c b/src/basic/util.c index 3e90456dd3..3989b415fa 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -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; -- cgit v1.2.3-54-g00ecf