Merge pull request #18518 from poettering/inhibit-limit-columns
put a width limit on the "systemd-inhibit --list" table
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user