mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
systemct: add empty line between units in cat
This commit is contained in:
parent
495cb9bbeb
commit
a669d6226d
@ -3746,6 +3746,7 @@ static int cat(sd_bus *bus, char **args) {
|
||||
_cleanup_free_ char *unit = NULL, *n = NULL;
|
||||
int r = 0;
|
||||
char **name;
|
||||
bool first = true;
|
||||
|
||||
assert(bus);
|
||||
assert(args);
|
||||
@ -3796,8 +3797,13 @@ static int cat(sd_bus *bus, char **args) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
puts("");
|
||||
|
||||
if (!isempty(fragment_path)) {
|
||||
fprintf(stdout, "%s# %s%s\n",
|
||||
printf("%s# %s%s\n",
|
||||
ansi_highlight_blue(),
|
||||
fragment_path,
|
||||
ansi_highlight_off());
|
||||
@ -3811,7 +3817,7 @@ static int cat(sd_bus *bus, char **args) {
|
||||
}
|
||||
|
||||
STRV_FOREACH(path, dropin_paths) {
|
||||
fprintf(stdout, "%s# %s\n",
|
||||
printf("%s# %s\n",
|
||||
isempty(fragment_path) && path == dropin_paths ? "" : "\n",
|
||||
*path);
|
||||
fflush(stdout);
|
||||
|
Loading…
Reference in New Issue
Block a user