From ccb51440502813c153b777d167cde085074d8a8e Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Fri, 10 Feb 2012 10:10:10 -0600 Subject: [PATCH] top: fix regression created when fields mgmt reorg'd When the calibrate_fields function was broken up for mainainability, an obscure regression was introduced. For the resulting bug to affect the display, all of the following conditions would have to be met: . USE_X_COLHDR was not defined . column highlighting had been turned on . many, perhaps all, fields were displayable . the user then typed the key . and the current sort column just happened to be immediately to the left of the left-most visible field This patch corrects for that remote possibility. Reference: commit d0e16acf156b066d56415b1b7ccbfad4ae1526d8 Signed-off-by: Jim Warner --- top/top.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/top/top.c b/top/top.c index 853a64eb..1d89711a 100644 --- a/top/top.c +++ b/top/top.c @@ -1538,6 +1538,9 @@ static void calibrate_fields (void) { s = scat(s, h); w->endpflg = i; } +#ifndef USE_X_COLHDR + if (X_XOF == w->pflgsall[w->endpflg]) ++w->endpflg; +#endif } // end: if (VIZISw(w)) if (Rc.mode_altscr) w = w->next;