NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/52063: halfdelay() does not honour timeout value

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

From: Brett Lymn <>
        Onno van der Linden <>
Subject: Re: lib/52063: halfdelay() does not honour timeout value
Date: Wed, 8 Aug 2018 08:02:33 +0930

 On Tue, Aug 07, 2018 at 07:55:01PM +0000, Onno van der Linden wrote:
 >  After Brett Lymn told me he wasn't comfortable with the patch I tried
 >  to come up with something better. Noticed a difference between
 >  wgetch() and wget_wch() in handling win->delay. Made that handling
 >  in wgetch() equal to wget_wch():
 >  $ diff -u `pwd`/getch.c.orig `pwd`/getch.c
 >  --- /usr/src/lib/libcurses/getch.c.orig 2017-01-31 10:17:53.000000000 +0100
 >  +++ /usr/src/lib/libcurses/getch.c      2018-08-07 21:33:41.361102323 +0200
 >  @@ -867,8 +867,6 @@
 >                  switch (win->delay)
 >                  {
 >                  case -1:
 >  -                       if (__delay() == ERR)
 >  -                               return ERR;
 >                          break;
 >                  case 0:
 >                          if (__nodelay() == ERR)
 >  And now the testscript works fine.
 Sorry Onno, I know that would work but looking at it this bug goes a bit
 deeper.  I think that what both wgetch and wget_wch are doing is
 incorrect.  Looking at SUSv2, it says that halfdelay should apply to the
 current window.  Our curses is, as Simon pointed out, applying the
 setting to the screen.  I think what we need to do is fix halfdelay so
 it applies to the window and fix both wgetch and wget_wch so they
 correctly set halfdelay for the window.
 This will fix your bug and make our curses correct as per SUSv2.
 Brett Lymn
 Let go, or be dragged - Zen proverb.

Home | Main Index | Thread Index | Old Index