bus-unit-util: properly serialize EnvironmentFile= empty assignment

In that case we need to generate an empty array.
This commit is contained in:
Lennart Poettering 2017-11-29 11:33:26 +01:00
parent 7ae8162f29
commit 5716965132

View file

@ -134,9 +134,12 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
} else if (streq(field, "EnvironmentFile")) { } else if (streq(field, "EnvironmentFile")) {
r = sd_bus_message_append(m, "sv", "EnvironmentFiles", "a(sb)", 1, if (isempty(eq))
eq[0] == '-' ? eq + 1 : eq, r = sd_bus_message_append(m, "sv", "EnvironmentFiles", "a(sb)", 0);
eq[0] == '-'); else
r = sd_bus_message_append(m, "sv", "EnvironmentFiles", "a(sb)", 1,
eq[0] == '-' ? eq + 1 : eq,
eq[0] == '-');
goto finish; goto finish;
} else if (STR_IN_SET(field, "AccuracySec", "RandomizedDelaySec", "RuntimeMaxSec")) { } else if (STR_IN_SET(field, "AccuracySec", "RandomizedDelaySec", "RuntimeMaxSec")) {