From 3da298c1d6b9c82e99e7025162657a8b5e2ce551 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Mon, 3 Aug 2015 00:00:00 -0500 Subject: [PATCH] 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 --- top/top.c | 1 + 1 file changed, 1 insertion(+) 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 */ -- 2.40.0