From dea7b6b043f0cd9e34ee719b9b612c3a4776387e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 23 Oct 2015 18:20:54 +0200 Subject: util-lib: rework extract_first_word_and_warn() a bit - Really warn in all error cases, not just some. We need to make sure that all errors are logged to not confuse the user. - Explicitly check for EINVAL error code before claiming anything about invalid escapes, could be ENOMEM after all. --- src/core/load-fragment.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/core/load-fragment.c') diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index a361de2a4a..0500e2ba33 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -522,9 +522,7 @@ int config_parse_exec( assert(e); e += ltype; - rvalue += strspn(rvalue, WHITESPACE); - p = rvalue; if (isempty(rvalue)) { /* An empty assignment resets the list */ @@ -532,14 +530,15 @@ int config_parse_exec( return 0; } + p = rvalue; do { - int i; + _cleanup_free_ char *path = NULL, *firstword = NULL; + bool separate_argv0 = false, ignore = false; + _cleanup_free_ ExecCommand *nce = NULL; _cleanup_strv_free_ char **n = NULL; size_t nlen = 0, nbufsize = 0; - _cleanup_free_ ExecCommand *nce = NULL; - _cleanup_free_ char *path = NULL, *firstword = NULL; char *f; - bool separate_argv0 = false, ignore = false; + int i; semicolon = false; -- cgit v1.2.3-54-g00ecf