From 8a07b4033e5d3c86931b3dd2ddbca41118c05c60 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 17 Jul 2019 11:13:20 +0200 Subject: shared/conf-parser,networkd: EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE → EXTRACT_UNQUOTE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's hard to even say what exactly this combination means. Escaping is necessary when quoting to have quotes within the string. So the escaping of quote characters is inherently tied to quoting. When unquoting, it seems natural to remove escaping which was done for the quoting purposes. But with both flags we would be expected to re-add this escaping after unqouting? Or maybe keep the escaping which is not necessary for quoting but otherwise present? This all seems too complicated, let's just forbid such usage and always fully unescape when unquoting. --- src/basic/extract-word.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/basic') diff --git a/src/basic/extract-word.c b/src/basic/extract-word.c index 34cfb36a4a..b7ae2ed1cd 100644 --- a/src/basic/extract-word.c +++ b/src/basic/extract-word.c @@ -28,6 +28,8 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra assert(p); assert(ret); + /* Those two don't make sense together. */ + assert(!FLAGS_SET(flags, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE)); /* Bail early if called after last value or with no input */ if (!*p) -- cgit v1.2.3