Merge pull request #94 from arieboven/master - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
 (HTM) git clone https://git.drkhsh.at/tty-clock.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit f2f847cf2cc2949c8a8b7779a778f366d3743474
 (DIR) parent 06d0d0b4c5b1a0afbcf899f4014b3c3598c3b665
 (HTM) Author: anarcat <anarcat@users.noreply.github.com>
       Date:   Sun, 21 Nov 2021 10:14:31 -0500
       
       Merge pull request #94 from arieboven/master
       
       Update window when date string change
       Diffstat:
         M ttyclock.c                          |      10 ++++++++++
         M ttyclock.h                          |       1 +
       
       2 files changed, 11 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/ttyclock.c b/ttyclock.c
       @@ -200,6 +200,7 @@ update_hour(void)
             ttyclock.date.minute[1] = ttyclock.tm->tm_min % 10;
        
             /* Set date string */
       +     strcpy(ttyclock.date.old_datestr, ttyclock.date.datestr);
             strftime(tmpstr,
                      sizeof(tmpstr),
                      ttyclock.option.format,
       @@ -242,6 +243,15 @@ draw_number(int n, int x, int y)
        void
        draw_clock(void)
        {
       +     if (ttyclock.option.date && !ttyclock.option.rebound &&
       +               strcmp(ttyclock.date.datestr, ttyclock.date.old_datestr) != 0)
       +     {
       +          clock_move(ttyclock.geo.x,
       +                     ttyclock.geo.y,
       +                     ttyclock.geo.w,
       +                     ttyclock.geo.h);
       +     }
       +
             /* Draw hour numbers */
             draw_number(ttyclock.date.hour[0], 1, 1);
             draw_number(ttyclock.date.hour[1], 1, 8);
 (DIR) diff --git a/ttyclock.h b/ttyclock.h
       @@ -102,6 +102,7 @@ typedef struct
                  unsigned int minute[2];
                  unsigned int second[2];
                  char datestr[256];
       +          char old_datestr[256];
             } date;
        
             /* time.h utils */