diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-10-23 18:20:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-24 23:03:49 +0200 |
commit | dea7b6b043f0cd9e34ee719b9b612c3a4776387e (patch) | |
tree | 1e46775676ee8ac282bd912d52f0f6e55892227d /src/core/load-fragment.c | |
parent | 84ac7bea360cd369df26910e9685a7eed2327088 (diff) |
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.
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 11 |
1 files changed, 5 insertions, 6 deletions
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; |