summaryrefslogtreecommitdiffstats
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-17 11:13:20 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-17 11:35:04 +0200
commit8a07b4033e5d3c86931b3dd2ddbca41118c05c60 (patch)
treeb7a3941d5ba8c28ff256464b7e01f3de935b5691 /src/basic
parentnspawn: fix misplaced parenthesis and merge two error handling paths (diff)
downloadsystemd-8a07b4033e5d3c86931b3dd2ddbca41118c05c60.tar.xz
systemd-8a07b4033e5d3c86931b3dd2ddbca41118c05c60.zip
shared/conf-parser,networkd: EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE → EXTRACT_UNQUOTE
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.
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/extract-word.c2
1 files changed, 2 insertions, 0 deletions
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)