From 1b93a8aeaacc07de6d2aa08e658402b54446f064 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 17 Jan 2021 01:35:02 +0000 Subject: [PATCH] ncurses 6.2 - patch 20210116 + add comment for linux2.6 regarding CONFIG_CONSOLE_TRANSLATIONS (report by Patrick McDermott) -TD + make opts extension for getcchar work as documented for ncurses 6.1, adding "-g" flag to test/demo_new_pair to illustrate. --- NEWS | 8 +++++- VERSION | 2 +- dist.mk | 4 +-- misc/terminfo.src | 26 ++++++++++++++++-- ncurses/widechar/lib_cchar.c | 15 ++++++++--- package/debian-mingw/changelog | 4 +-- package/debian-mingw64/changelog | 4 +-- package/debian/changelog | 4 +-- package/mingw-ncurses.nsi | 4 +-- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- package/ncursest.spec | 2 +- test/demo_new_pair.c | 46 +++++++++++++++++++++++++++++--- 13 files changed, 98 insertions(+), 25 deletions(-) diff --git a/NEWS b/NEWS index 9a19b964..c04424f4 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3616 2021/01/09 11:03:34 tom Exp $ +-- $Id: NEWS,v 1.3619 2021/01/17 00:50:16 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,12 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20210116 + + add comment for linux2.6 regarding CONFIG_CONSOLE_TRANSLATIONS + (report by Patrick McDermott) -TD + + make opts extension for getcchar work as documented for ncurses 6.1, + adding "-g" flag to test/demo_new_pair to illustrate. + 20210109 + fix errata in man/ncurses.3x from recent updates. + improve quoting/escaping in configure script, uses some features of diff --git a/VERSION b/VERSION index f008600f..75a9a075 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.2 20210109 +5:0:10 6.2 20210116 diff --git a/dist.mk b/dist.mk index f1a41302..a070f966 100644 --- a/dist.mk +++ b/dist.mk @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1395 2021/01/09 09:49:29 tom Exp $ +# $Id: dist.mk,v 1.1396 2021/01/16 10:31:57 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -38,7 +38,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 2 -NCURSES_PATCH = 20210109 +NCURSES_PATCH = 20210116 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/misc/terminfo.src b/misc/terminfo.src index 3b683c65..3f235b1e 100644 --- a/misc/terminfo.src +++ b/misc/terminfo.src @@ -6,8 +6,8 @@ # Report bugs and new terminal descriptions to # bug-ncurses@gnu.org # -# $Revision: 1.840 $ -# $Date: 2020/12/28 00:40:10 $ +# $Revision: 1.841 $ +# $Date: 2021/01/17 00:39:21 $ # # The original header is preserved below for reference. It is noted that there # is a "newer" version which differs in some cosmetic details (but actually @@ -1028,6 +1028,24 @@ linux2.2|linux 2.2.x console, # 'p' scan line 3 # 'r' scan line 7 # '_' scan line 9 +# +# The fix for SI/SO is part of a configurable (i.e., "optional") kernel feature +# misleadingly called CONFIG_CONSOLE_TRANSLATIONS. Disabling that not only +# omits the line-drawing using SI/SO, but also part/all of the Unicode feature: +# +# https://cateee.net/lkddb/web-lkddb/CONSOLE_TRANSLATIONS.html +# "This enables support for font mapping and Unicode translation on virtual consoles." +# +# This mailing list thread in July 2008 illustrates: +# +# https://marc.info/?t=121734656700005&r=1&w=4 +# "commit a29ccf6f823a84d89e1c7aaaf221cf7282022024 break console on slackware 12.1" +# +# The change which made it configurable was to reduce the size for use in +# embedded systems. Some background is found in +# +# https://lwn.net/Articles/284767/ +# "An interview with the new embedded maintainers" linux2.6|linux 2.6.x console, acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxy yzz{{||}}~~, @@ -26778,4 +26796,8 @@ v3220|LANPAR Vision II model 3220/3221/3222, # 2020-12-27 # + update terminology to 1.8.1 -TD # +# 2021-01-16 +# + add comment for linux2.6 regarding CONFIG_CONSOLE_TRANSLATIONS +# (report by Patrick McDermott) -TD +# ######## SHANTIH! SHANTIH! SHANTIH! diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index 322fe855..62a1113e 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 Thomas E. Dickey * * Copyright 2001-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: lib_cchar.c,v 1.34 2020/07/11 22:55:08 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.35 2021/01/17 00:04:08 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -56,7 +56,7 @@ setcchar(cchar_t *wcval, int color_pair = pair_arg; unsigned len; - TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), + TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,attrs=%lu,pair=%d,%p)"), (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); @@ -114,7 +114,12 @@ getcchar(const cchar_t *wcval, (void *) pair_arg, opts)); - if (opts == NULL && wcval != NULL) { +#if !NCURSES_EXT_COLORS + if (opts != NULL) { + ; /* empty */ + } else +#endif + if (wcval != NULL) { wchar_t *wp; int len; @@ -131,6 +136,8 @@ getcchar(const cchar_t *wcval, } else if (attrs == 0 || pair_arg == 0) { code = ERR; } else if (len >= 0) { + TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, + _tracecchar_t(wcval))); *attrs = AttrOf(*wcval) & A_ATTRIBUTES; color_pair = GetPair(*wcval); get_extended_pair(opts, color_pair); diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index fcb7c07e..2350bbde 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20210109) unstable; urgency=low +ncurses6 (6.2+20210116) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Mon, 04 Jan 2021 03:45:02 -0500 + -- Thomas E. Dickey Sat, 16 Jan 2021 05:31:57 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index fcb7c07e..2350bbde 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20210109) unstable; urgency=low +ncurses6 (6.2+20210116) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Mon, 04 Jan 2021 03:45:02 -0500 + -- Thomas E. Dickey Sat, 16 Jan 2021 05:31:57 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index be6c77b6..f413bc67 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20210109) unstable; urgency=low +ncurses6 (6.2+20210116) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Mon, 04 Jan 2021 03:45:02 -0500 + -- Thomas E. Dickey Sat, 16 Jan 2021 05:31:57 -0500 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index b55e9a9a..542a0cef 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.438 2021/01/09 09:49:29 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.439 2021/01/16 10:31:57 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "2" !define VERSION_YYYY "2021" -!define VERSION_MMDD "0109" +!define VERSION_MMDD "0116" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 3be9cacd..45d8b6bc 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.2 -Release: 20210109 +Release: 20210116 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 23ef6244..a2ee5190 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.2 -Release: 20210109 +Release: 20210116 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 537322a9..b7a58433 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.2 -Release: 20210109 +Release: 20210116 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/demo_new_pair.c b/test/demo_new_pair.c index bd62a089..909423e2 100644 --- a/test/demo_new_pair.c +++ b/test/demo_new_pair.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_new_pair.c,v 1.21 2020/02/02 23:34:34 tom Exp $ + * $Id: demo_new_pair.c,v 1.23 2021/01/17 00:11:09 tom Exp $ * * Demonstrate the alloc_pair() function. */ @@ -136,6 +136,7 @@ usage(void) "Repeatedly print using all possible color combinations.", "", "Options:", + " -g use getcchar to check setcchar", " -i use init_pair rather than alloc_pair", " -p start in paged-mode", " -s start in single-step mode", @@ -186,6 +187,7 @@ main(int argc, char *argv[]) }; bool done = FALSE; + bool check_set = FALSE; bool clobber = FALSE; bool hascolor = FALSE; bool use_init = FALSE; @@ -202,8 +204,11 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "ipsw")) != -1) { + while ((ch = getopt(argc, argv, "gipsw")) != -1) { switch (ch) { + case 'g': + check_set = TRUE; + break; case 'i': use_init = TRUE; break; @@ -317,7 +322,7 @@ main(int argc, char *argv[]) : make_color(current)); } } else { - my_attrs = next_attr(current); + my_attrs = next_attr(current); my_pair = 0; } if (my_pair < 0) @@ -327,6 +332,39 @@ main(int argc, char *argv[]) setcchar(&temp, wch, my_attrs, (short) my_pair, (use_init ? NULL : (void *) &my_pair)); + + if (check_set) { + int problem = 0; + wchar_t chk_wch[2]; + attr_t chk_attrs = 0; + short chk_pair = 0; + int chk_pair2 = 0; + +#define AllButColor(a) ((a) & (A_ATTRIBUTES & ~A_COLOR)) + + if (getcchar(&temp, NULL, &chk_attrs, &chk_pair, + (use_init ? NULL : (void *) &chk_pair2)) != 2) { + problem = 1; + } else if (getcchar(&temp, chk_wch, &chk_attrs, &chk_pair, + (use_init ? NULL : (void *) &chk_pair2)) != OK) { + problem = 2; + } else if (chk_wch[0] != wch[0]) { + problem = 3; + } else if (AllButColor(my_attrs) != AllButColor(chk_attrs)) { + problem = 4; + } else if (my_pair != chk_pair) { + problem = 4; + } else if (!use_init && (my_pair != chk_pair2)) { + problem = 5; + } + if (problem) { + wch[0] = problem + '0'; + setcchar(&temp, wch, my_attrs, + (short) my_pair, + (use_init ? NULL : (void *) &my_pair)); + } + } + /* * At the end of a page, move the cursor to the home position. */ -- 2.44.0