Merge pull request #18518 from poettering/inhibit-limit-columns

put a width limit on the "systemd-inhibit --list" table
This commit is contained in:
Lennart Poettering
2021-02-09 17:14:25 +01:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1
View File
@@ -90,6 +90,7 @@ static int print_inhibitors(sd_bus *bus) {
/* If there's not enough space, shorten the "WHY" column, as it's little more than an explaining comment. */
(void) table_set_weight(table, TABLE_HEADER_CELL(6), 20);
(void) table_set_maximum_width(table, TABLE_HEADER_CELL(0), columns()/2);
r = sd_bus_message_enter_container(reply, SD_BUS_TYPE_ARRAY, "(ssssuu)");
if (r < 0)
+1 -2
View File
@@ -1993,8 +1993,7 @@ int table_print(Table *t, FILE *f) {
if (width[j] < minimum_width[j])
width[j] = minimum_width[j];
assert(width[j] >= requested_width[j]);
delta = width[j] - requested_width[j];
delta = LESS_BY(width[j], requested_width[j]);
/* Subtract what we just added from the rest */
if (extra > delta)