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: v3.3.11~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3da298c1d6b9c82e99e7025162657a8b5e2ce551;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 5686c136..9d0e56aa 100644 --- a/top/top.c +++ b/top/top.c @@ -1994,6 +1994,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 */