summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorroy <roy@NetBSD.org>2018-10-04 19:11:09 +0000
committerroy <roy@NetBSD.org>2018-10-04 19:11:09 +0000
commit47e9792d8db2f88854a71f9afa2a4e58882f06e7 (patch)
treec77709699dec11dfbb17a7e6e9259fac5284c8dd /lib
parent261d0c98eba3ba2f0abaabfe91804f5b50c31b08 (diff)
curses: once __slk_init is called, reset slk_fmt
This allows soft label keys to be used on more than one terminal.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcurses/slk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libcurses/slk.c b/lib/libcurses/slk.c
index 73294bdc740..ff9509bcd31 100644
--- a/lib/libcurses/slk.c
+++ b/lib/libcurses/slk.c
@@ -1,4 +1,4 @@
-/* $NetBSD: slk.c,v 1.3 2018/10/04 18:40:41 roy Exp $ */
+/* $NetBSD: slk.c,v 1.4 2018/10/04 19:11:09 roy Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: slk.c,v 1.3 2018/10/04 18:40:41 roy Exp $");
+__RCSID("$NetBSD: slk.c,v 1.4 2018/10/04 19:11:09 roy Exp $");
#endif /* not lint */
#include <ctype.h>
@@ -560,10 +560,12 @@ __slk_init(SCREEN *screen)
{
__slk_free(screen); /* safety */
+
+ screen->slk_format = slk_fmt;
if (slk_fmt == SLK_FMT_INVAL)
return OK;
+ slk_fmt = SLK_FMT_INVAL;
- screen->slk_format = slk_fmt;
switch(screen->slk_format) {
case SLK_FMT_3_2_3:
case SLK_FMT_4_4: