void-packages/srcpkgs/procps/patches/3.2.5-top-sort.patch

40 lines
1.3 KiB
Diff

Under certain conditions, top's display can break.
This patch is by Curtis Doty, updated by Andreas Kling for 3.2.5.
To reproduce bug:
- run top
- turn on color mode ('z')
- highlight sort column ('x')
- move sort column all the way to the left ('<')
- get drunk
procps e-mail: http://sourceforge.net/mailarchive/forum.php?thread_id=6042978&forum_id=12454
Redhat bug: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=140975
Gentoo bug: http://bugs.gentoo.org/show_bug.cgi?id=80296
--- top.c~ 2005-01-26 06:15:18.000000000 +0100
+++ top.c 2005-02-01 09:23:35.000000000 +0100
@@ -2952,12 +2952,10 @@
for (x = 0; x < q->maxpflgs; x++) {
char cbuf[ROWBUFSIZ], _z[ROWBUFSIZ];
FLG_t i = q->procflags[x]; // support for our field/column
- const char *f = Fieldstab[i].fmts; // macro AND sometimes the fmt
+ const char *f = Fieldstab[i].fmts + ((x==0) && !Rc.mode_altscr);
unsigned s = Fieldstab[i].scale; // string must be altered !
unsigned w = Fieldstab[i].width;
- int advance = (x==0) && !Rc.mode_altscr;
-
switch (i) {
case P_CMD:
{ char tmp[ROWBUFSIZ];
@@ -3069,7 +3067,7 @@
} /* end: switch 'procflag' */
- rp = scat(rp, cbuf+advance);
+ rp = scat(rp, cbuf);
} /* end: for 'maxpflgs' */
PUFF(