From: Zbigniew Jędrzejewski-Szmek Date: Mon, 25 Apr 2016 01:54:52 +0000 (-0400) Subject: systemctl: do not print header if no units will be listed X-Git-Tag: v230~70^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=11690bcc5051e777ff2ff78e5bd6c089c6bd8aba;p=thirdparty%2Fsystemd.git systemctl: do not print header if no units will be listed "0 units listed." is still printed. --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 75248c83b30..639080bc663 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1355,7 +1355,7 @@ static void output_unit_file_list(const UnitFileList *units, unsigned c) { } else id_cols = max_id_len; - if (!arg_no_legend) + if (!arg_no_legend && c > 0) printf("%-*s %-*s\n", id_cols, "UNIT FILE", state_cols, "STATE");