From: Jim Warner Date: Mon, 3 Aug 2015 05:00:00 +0000 (-0500) Subject: top: fix unlikely edge case wherein all fields are off X-Git-Tag: v4.0.0~1077 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=180bbb4032d8ab0e22f05ed26bf183942009dfe5;p=procps-ng top: fix unlikely edge case wherein all fields are off While testing a newlib interface for pids acquisitions I encountered some unexpected results if an idiot user (me) turns off all displayable fields. So, this commit ensures that the PID field will be shown as a minimum. Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index 0d51a88f..00658018 100644 --- a/top/top.c +++ b/top/top.c @@ -2021,6 +2021,7 @@ static void calibrate_fields (void) { #endif } } + if (!w->totpflgs) w->pflgsall[w->totpflgs++] = EU_PID; /* build a preliminary columns header not to exceed screen width while accounting for a possible leading window number */