Magellan Linux

Annotation of /trunk/procps/patches/3.2.5-top-sort.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years, 1 month ago) by niro
File size: 1384 byte(s)
-import

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