ports/164818: sysutils/tty-clock may be fixed on 9.0

Sergey Kronshtadtov svk at sbm-group.com
Tue Mar 27 05:50:11 UTC 2012


The following reply was made to PR ports/164818; it has been noted by GNATS.

From: Sergey Kronshtadtov <svk at sbm-group.com>
To: bug-followup at FreeBSD.org, svk at arm.ru
Cc:  
Subject: Re: ports/164818: sysutils/tty-clock may be fixed on 9.0
Date: Tue, 27 Mar 2012 09:23:34 +0400

  From the same environment:
 =====
 clock01# diff -uN ttyclock.c.save.00 ttyclock.c.save.01.fixed
 --- ttyclock.c.save.00  2012-02-03 18:00:30.000000000 +0400
 +++ ttyclock.c.save.01.fixed    2012-02-10 09:11:58.000000000 +0400
 @@ -174,21 +174,20 @@
   }
 
   void
 -draw_number(int n, int x, int y)
 +draw_number(int n, int y, int x)
   {
 -     int i, sy = y;
 +     int i, sx = x;
 
 -     for(i = 0; i < 30; ++i, ++sy)
 +     for(i = 0; i < 30; ++i, ++sx)
        {
 -          if(sy == y + 6)
 +          if(sx == x + 6)
             {
 -               sy = y;
 -               ++x;
 +               sx = x;
 +               ++y;
             }
             wbkgdset(ttyclock->framewin, COLOR_PAIR(number[n][i/2]));
 -          mvwaddch(ttyclock->framewin, x, sy, ' ');
 +          mvwaddch(ttyclock->framewin, y, sx, ' ');
        }
 -     wrefresh(ttyclock->framewin);
 
        return;
   }
 @@ -209,11 +208,6 @@
        draw_number(ttyclock->date.minute[0], 1, 20);
        draw_number(ttyclock->date.minute[1], 1, 27);
 
 -     /* Draw the date */
 -     wbkgdset(ttyclock->datewin, (COLOR_PAIR(2)));
 -     mvwprintw(ttyclock->datewin, (DATEWINH / 2), 1, 
 ttyclock->date.datestr);
 -     wrefresh(ttyclock->datewin);
 -
        /* Draw second if the option is enable */
        if(ttyclock->option.second)
        {
 @@ -227,6 +221,14 @@
             draw_number(ttyclock->date.second[1], 1, 46);
        }
 
 +     wrefresh(ttyclock->framewin);
 +
 +     /* Draw the date */
 +     wbkgdset(ttyclock->datewin, (COLOR_PAIR(2)));
 +     mvwprintw(ttyclock->datewin, (DATEWINH / 2), 1, 
 ttyclock->date.datestr);
 +
 +     wrefresh(ttyclock->datewin);
 +
        return;
   }
 
 clock01#
 =====



More information about the freebsd-ports-bugs mailing list