From 180bbb4032d8ab0e22f05ed26bf183942009dfe5 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 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 */