various: handle the positive condition after strv_skip() first

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-03-27 12:04:37 +01:00
parent 129446ddec
commit fdfa9fd8ab
3 changed files with 22 additions and 20 deletions
+5 -5
View File
@@ -171,14 +171,14 @@ int verb_list_dependencies(int argc, char *argv[], void *userdata) {
return r;
patterns = strv_skip(argv, 1);
if (strv_isempty(patterns)) {
units = strv_new(SPECIAL_DEFAULT_TARGET);
if (!units)
return log_oom();
} else {
if (patterns) {
r = expand_unit_names(bus, patterns, NULL, &units, NULL);
if (r < 0)
return log_error_errno(r, "Failed to expand names: %m");
} else {
units = strv_new(SPECIAL_DEFAULT_TARGET);
if (!units)
return log_oom();
}
pager_open(arg_pager_flags);