chiark / gitweb /
Revert "systemctl: append default suffix only if none present"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Nov 2014 17:25:09 +0000 (12:25 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 28 Nov 2014 17:28:44 +0000 (12:28 -0500)
This reverts a chunk out of commit 5e03c6e3b517286bbd65b48d88f60e5b83721894
which was trying to pass NULL to the the '.service' default. Anyway,
it seems better to be explicit.

src/systemctl/systemctl.c

index 263755f..4299429 100644 (file)
@@ -2701,7 +2701,10 @@ static int expand_names(sd_bus *bus, char **names, const char* suffix, char ***r
         STRV_FOREACH(name, names) {
                 char *t;
 
-                t = unit_name_mangle_with_suffix(*name, MANGLE_GLOB, suffix);
+                if (suffix)
+                        t = unit_name_mangle_with_suffix(*name, MANGLE_GLOB, suffix);
+                else
+                        t = unit_name_mangle(*name, MANGLE_GLOB);
                 if (!t)
                         return log_oom();