Source-Changes-HG archive

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

[src/netbsd-8]: src/lib/libcurses Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/f8bfb521923a
branches:  netbsd-8
changeset: 435293:f8bfb521923a
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Oct 08 19:06:52 2018 +0000

description:
Pull up following revision(s) (requested by roy in ticket #1048):

        lib/libcurses/curses_private.h: revision 1.66
        lib/libcurses/slk.c: revision 1.3
        lib/libcurses/slk.c: revision 1.4

curses: declare SLK format as invalid until slk_init(3) called

If we don't, then when __slk_init with a valid format of 0 it sets
up labels to be drawn without a window.

 -

curses: once __slk_init is called, reset slk_fmt

This allows soft label keys to be used on more than one terminal.

diffstat:

 lib/libcurses/curses_private.h |   3 ++-
 lib/libcurses/slk.c            |  10 +++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r 503ab98497c9 -r f8bfb521923a lib/libcurses/curses_private.h
--- a/lib/libcurses/curses_private.h    Thu Oct 04 10:21:11 2018 +0000
+++ b/lib/libcurses/curses_private.h    Mon Oct 08 19:06:52 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: curses_private.h,v 1.62.4.2 2018/10/04 10:20:12 martin Exp $   */
+/*     $NetBSD: curses_private.h,v 1.62.4.3 2018/10/08 19:06:52 martin Exp $   */
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -289,6 +289,7 @@
        bool             is_term_slk;
        WINDOW          *slk_window;
        int              slk_format;
+#define        SLK_FMT_INVAL   -1
 #define        SLK_FMT_3_2_3   0
 #define        SLK_FMT_4_4     1
        int              slk_nlabels;
diff -r 503ab98497c9 -r f8bfb521923a lib/libcurses/slk.c
--- a/lib/libcurses/slk.c       Thu Oct 04 10:21:11 2018 +0000
+++ b/lib/libcurses/slk.c       Mon Oct 08 19:06:52 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: slk.c,v 1.2 2017/01/30 17:15:52 roy Exp $      */
+/*     $NetBSD: slk.c,v 1.2.8.1 2018/10/08 19:06:52 martin Exp $       */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.2 2017/01/30 17:15:52 roy Exp $");
+__RCSID("$NetBSD: slk.c,v 1.2.8.1 2018/10/08 19:06:52 martin Exp $");
 #endif                         /* not lint */
 
 #include <ctype.h>
@@ -57,7 +57,7 @@
 #define        SLK_SIZE        MAX_SLK_COLS
 #endif
 
-static int      slk_fmt;       /* fmt of slk_init */
+static int      slk_fmt = SLK_FMT_INVAL;       /* fmt of slk_init */
 
 /* Safe variants of public functions. */
 static int      __slk_attron(SCREEN *, const chtype);
@@ -562,6 +562,10 @@
        __slk_free(screen);     /* safety */
 
        screen->slk_format = slk_fmt;
+       if (slk_fmt == SLK_FMT_INVAL)
+               return OK;
+       slk_fmt = SLK_FMT_INVAL;
+
        switch(screen->slk_format) {
        case SLK_FMT_3_2_3:
        case SLK_FMT_4_4:



Home | Main Index | Thread Index | Old Index