Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses Fix for PR lib/52063



details:   https://anonhg.NetBSD.org/src/rev/98c12bc35fdd
branches:  trunk
changeset: 994632:98c12bc35fdd
user:      blymn <blymn%NetBSD.org@localhost>
date:      Fri Nov 16 10:12:00 2018 +0000

description:
Fix for PR lib/52063
Many thanks to  Onno van der Linden (o.vd.linden%quicknet.nl@localhost) for providing
the bulk of the patch that fixes the issue.

diffstat:

 lib/libcurses/curses_private.h |   4 ++--
 lib/libcurses/fileio.h         |   4 ++--
 lib/libcurses/screen.c         |   5 ++---
 lib/libcurses/shlib_version    |   4 ++--
 lib/libcurses/tty.c            |  16 +++++++++-------
 5 files changed, 17 insertions(+), 16 deletions(-)

diffs (127 lines):

diff -r 369724061856 -r 98c12bc35fdd lib/libcurses/curses_private.h
--- a/lib/libcurses/curses_private.h    Fri Nov 16 10:09:29 2018 +0000
+++ b/lib/libcurses/curses_private.h    Fri Nov 16 10:12:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: curses_private.h,v 1.67 2018/10/29 00:25:20 uwe Exp $  */
+/*     $NetBSD: curses_private.h,v 1.68 2018/11/16 10:12:00 blymn Exp $        */
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -133,6 +133,7 @@
 #define __ISDERWIN     0x00100000      /* "window" is derived from parent */
 #define __IMMEDOK      0x00200000      /* refreshed when changed */
 #define __SYNCOK       0x00400000      /* sync when changed */
+#define __HALFDELAY    0x00800000      /* In half delay mode */
        unsigned int flags;
        int     delay;                  /* delay for getch() */
        attr_t  wattr;                  /* Character attributes */
@@ -278,7 +279,6 @@
        char padchar;
        int endwin;
        int notty;
-       int half_delay;
        int resized;
        wchar_t *unget_list;
        int unget_len, unget_pos;
diff -r 369724061856 -r 98c12bc35fdd lib/libcurses/fileio.h
--- a/lib/libcurses/fileio.h    Fri Nov 16 10:09:29 2018 +0000
+++ b/lib/libcurses/fileio.h    Fri Nov 16 10:12:00 2018 +0000
@@ -1,8 +1,8 @@
 /*
  * Do not edit!  Automatically generated file:
- *   from: NetBSD: shlib_version,v 1.41 2015/11/22 04:56:00 kamil Exp 
+ *   from: NetBSD: shlib_version,v 1.42 2017/01/02 12:38:16 roy Exp 
  *   by  : NetBSD: genfileioh.awk,v 1.2 2008/05/02 11:13:02 martin Exp 
  */
 
 #define CURSES_LIB_MAJOR 7
-#define CURSES_LIB_MINOR 1
+#define CURSES_LIB_MINOR 2
diff -r 369724061856 -r 98c12bc35fdd lib/libcurses/screen.c
--- a/lib/libcurses/screen.c    Fri Nov 16 10:09:29 2018 +0000
+++ b/lib/libcurses/screen.c    Fri Nov 16 10:12:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: screen.c,v 1.34 2018/10/02 17:35:44 roy Exp $  */
+/*     $NetBSD: screen.c,v 1.35 2018/11/16 10:12:00 blymn Exp $        */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c   8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.34 2018/10/02 17:35:44 roy Exp $");
+__RCSID("$NetBSD: screen.c,v 1.35 2018/11/16 10:12:00 blymn Exp $");
 #endif
 #endif                                 /* not lint */
 
@@ -167,7 +167,6 @@
        new_screen->__virtscr = NULL;
        new_screen->curwin = 0;
        new_screen->notty = FALSE;
-       new_screen->half_delay = FALSE;
        new_screen->resized = 0;
        new_screen->unget_len = 32;
 
diff -r 369724061856 -r 98c12bc35fdd lib/libcurses/shlib_version
--- a/lib/libcurses/shlib_version       Fri Nov 16 10:09:29 2018 +0000
+++ b/lib/libcurses/shlib_version       Fri Nov 16 10:12:00 2018 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: shlib_version,v 1.42 2017/01/02 12:38:16 roy Exp $
+#      $NetBSD: shlib_version,v 1.43 2018/11/16 10:12:00 blymn Exp $
 #      Remember to update distrib/sets/lists/base/shl.* when changing
 #      Remember to run `make fileio.h` when changing
 #      Remember to increment the major numbers of libform, libmenu and
 #      libpanel when the libcurses major number increments.
 #
 major=7
-minor=1
+minor=2
diff -r 369724061856 -r 98c12bc35fdd lib/libcurses/tty.c
--- a/lib/libcurses/tty.c       Fri Nov 16 10:09:29 2018 +0000
+++ b/lib/libcurses/tty.c       Fri Nov 16 10:12:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.47 2018/10/18 07:53:13 roy Exp $     */
+/*     $NetBSD: tty.c,v 1.48 2018/11/16 10:12:00 blymn Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tty.c      8.6 (Berkeley) 1/10/95";
 #else
-__RCSID("$NetBSD: tty.c,v 1.47 2018/10/18 07:53:13 roy Exp $");
+__RCSID("$NetBSD: tty.c,v 1.48 2018/11/16 10:12:00 blymn Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -250,11 +250,11 @@
        if (_cursesi_screen->notty == TRUE)
                return OK;
          /* if we were in halfdelay mode then nuke the timeout */
-       if ((_cursesi_screen->half_delay == TRUE) &&
+       if ((stdscr->flags & __HALFDELAY) &&
            (__notimeout() == ERR))
                return ERR;
 
-       _cursesi_screen->half_delay = FALSE;
+       stdscr->flags &= ~__HALFDELAY;
        _cursesi_screen->curt = _cursesi_screen->useraw ?
                &_cursesi_screen->rawt : &_cursesi_screen->baset;
        return tcsetattr(fileno(_cursesi_screen->infd), TCSASOFT | TCSADRAIN,
@@ -275,10 +275,12 @@
        if (cbreak() == ERR)
                return ERR;
 
-       if (__timeout(duration) == ERR)
-               return ERR;
+       if (duration > 255)
+               stdscr->delay = 255;
+       else
+               stdscr->delay = duration;
 
-       _cursesi_screen->half_delay = TRUE;
+       stdscr->flags |= __HALFDELAY;
        return OK;
 }
 



Home | Main Index | Thread Index | Old Index