From c83f1f30b80253de8a1a6034e7b016fa55d24523 Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Fri, 5 Jun 2015 23:12:25 -0700 Subject: load-fragment: reset the list on an ExecStart= containing only whitespace This is consistent with how an empty string works in an ExecStart= statement. We should not differentiate between an empty string and whitespace only (since they look the same.) Update the test case with whitespace only to reflect that the list is reset. Tested that `test-unit-file` passes and other test cases are not affected. Installed the patched systemd binaries on a machine, booted it, looked for out of the usual behavior but did not find any. --- src/core/load-fragment.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 41ba4c7eb7..a48cb4029a 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -532,17 +532,15 @@ int config_parse_exec( e += ltype; - /* FIXME: ExecStart= clears the list, but ExecStart= - * doesn't, they should behave the same. */ + rvalue += strspn(rvalue, WHITESPACE); + p = rvalue; + if (isempty(rvalue)) { /* An empty assignment resets the list */ *e = exec_command_free_list(*e); return 0; } - rvalue += strspn(rvalue, WHITESPACE); - p = rvalue; - do { int i; _cleanup_strv_free_ char **n = NULL; -- cgit v1.2.3-54-g00ecf