From 4b1c17535115b70f4ddf4bf5850049b885a40173 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 19 Jun 2015 15:24:29 +0000 Subject: Convert unquote_*_word users to expect isempty(p) after the last entry This is so that, when called in a loop, unquote_first_word can distinguish between reaching the end of a string because it has consumed all the input before the end, and consuming all the input. This is important because we later add a flag that allows char *in = ""; char *out; unquote_first_word(&in, &out, flags); To put "" in out, and set in = NULL, so the trailing empty string of the input can be consumed, and mark that the input has been consumed. --- src/core/load-fragment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/load-fragment.c') diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 299172123e..fc5b3477ff 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -614,7 +614,7 @@ int config_parse_exec( path_kill_slashes(path); - for (;;) { + while (!isempty(p)) { _cleanup_free_ char *word = NULL; /* Check explicitly for an unquoted semicolon as -- cgit v1.2.3-54-g00ecf