diff options
-rw-r--r-- | src/core/load-fragment.c | 8 | ||||
-rw-r--r-- | src/test/test-unit-file.c | 6 |
2 files changed, 6 insertions, 8 deletions
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=<empty> clears the list, but ExecStart=<whitespace> - * 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; diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c index c7e8353b3b..8358789e6f 100644 --- a/src/test/test-unit-file.c +++ b/src/test/test-unit-file.c @@ -145,19 +145,19 @@ static void test_config_parse_exec(void) { assert_se(r == 0); assert_se(c1->command_next == NULL); - log_info("/* no command, check for bad memory access */"); + log_info("/* no command, whitespace only, reset */"); r = config_parse_exec(NULL, "fake", 3, "section", 1, "LValue", 0, " ", &c, NULL); assert_se(r == 0); - assert_se(c1->command_next == NULL); + assert_se(c == NULL); log_info("/* ignore && honour_argv0 */"); r = config_parse_exec(NULL, "fake", 4, "section", 1, "LValue", 0, "-@/RValue///slashes3 argv0a r1", &c, NULL); assert_se(r >= 0); - c1 = c1->command_next; + c1 = c; check_execcommand(c1, "/RValue/slashes3", "argv0a", "r1", NULL, true); log_info("/* ignore && honour_argv0 */"); |