From 8b6693ef8fb9e7bafb52d7c42fc3d15b7a1bea3f Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 21 Apr 2019 01:53:37 +0000 Subject: [PATCH] ncurses 6.1 - patch 20190420 + improve ifdef's for TABSIZE variable, to help with AIX/HPUX ports. --- NEWS | 5 ++++- VERSION | 2 +- dist.mk | 4 ++-- 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 +- progs/dump_entry.c | 5 ++--- progs/tic.c | 8 +++++--- test/knight.c | 6 ++++-- test/ncurses.c | 6 +++--- test/picsmap.c | 3 ++- test/test.priv.h | 27 ++++++++++++++++++++++++++- 16 files changed, 60 insertions(+), 28 deletions(-) diff --git a/NEWS b/NEWS index 95276710..572b75b8 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3308 2019/04/13 22:55:07 tom Exp $ +-- $Id: NEWS,v 1.3310 2019/04/20 20:23:58 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,9 @@ 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. +20190420 + + improve ifdef's for TABSIZE variable, to help with AIX/HPUX ports. + 20190413 + check for TABSIZE variable in test/configure script. + used test/test_arrays.c to improve Caps.aix1 and Caps.hpux11 diff --git a/VERSION b/VERSION index 090e7739..ad875c89 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20190413 +5:0:10 6.1 20190420 diff --git a/dist.mk b/dist.mk index 18c454ad..f8aa0543 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1278 2019/04/13 15:23:45 tom Exp $ +# $Id: dist.mk,v 1.1279 2019/04/20 15:00:19 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 1 -NCURSES_PATCH = 20190413 +NCURSES_PATCH = 20190420 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 6c1b9b4c..1bf383a8 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190413) unstable; urgency=low +ncurses6 (6.1+20190420) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 13 Apr 2019 11:23:45 -0400 + -- Thomas E. Dickey Sat, 20 Apr 2019 11:00:19 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 6c1b9b4c..1bf383a8 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190413) unstable; urgency=low +ncurses6 (6.1+20190420) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 13 Apr 2019 11:23:45 -0400 + -- Thomas E. Dickey Sat, 20 Apr 2019 11:00:19 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index f35d521f..008725cd 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190413) unstable; urgency=low +ncurses6 (6.1+20190420) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 13 Apr 2019 11:23:45 -0400 + -- Thomas E. Dickey Sat, 20 Apr 2019 11:00:19 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 67c85bea..04703cf9 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.324 2019/04/13 15:23:45 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.325 2019/04/20 15:00:19 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "1" !define VERSION_YYYY "2019" -!define VERSION_MMDD "0413" +!define VERSION_MMDD "0420" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index c2d41c50..927e2438 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.1 -Release: 20190413 +Release: 20190420 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 7e0c0bbe..2c2dad13 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.1 -Release: 20190413 +Release: 20190420 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 360834ee..a0faa12e 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.1 -Release: 20190413 +Release: 20190420 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/progs/dump_entry.c b/progs/dump_entry.c index 60a3d956..66b250b9 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.171 2019/01/21 15:11:51 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.172 2019/04/20 18:54:48 tom Exp $") #define DISCARD(string) string = ABSENT_STRING #define PRINTF (void) printf @@ -1078,8 +1078,7 @@ fmt_entry(TERMTYPE2 *tterm, WRAP_CONCAT; } else if (TcOutput()) { char *srccap = _nc_tic_expand(capability, TRUE, numbers); - int params = (((i < (int) SIZEOF(parametrized)) && - (i < STRCOUNT)) + int params = ((i < (int) SIZEOF(parametrized)) ? parametrized[i] : ((*srccap == 'k') ? 0 diff --git a/progs/tic.c b/progs/tic.c index 65b5fb75..33d1311e 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.272 2019/04/06 20:18:54 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.274 2019/04/20 20:28:19 tom Exp $") #define STDIN_NAME "" @@ -1937,6 +1937,8 @@ check_params(TERMTYPE2 *tp, const char *name, char *value, int extended) } expected = actual; } +#else + (void) extended; #endif if (params[0]) { @@ -2316,8 +2318,7 @@ static void check_infotocap(TERMTYPE2 *tp, int i, const char *value) { const char *name = ExtStrname(tp, i, strnames); - int params = (((i < (int) SIZEOF(parametrized)) && - (i < STRCOUNT)) + int params = ((i < (int) SIZEOF(parametrized)) ? parametrized[i] : ((*value == 'k') ? 0 @@ -2327,6 +2328,7 @@ check_infotocap(TERMTYPE2 *tp, int i, const char *value) char *tc_value; bool embedded; + assert(SIZEOF(parametrized) == STRCOUNT); if ((ti_value = _nc_tic_expand(value, TRUE, to_char)) == ABSENT_STRING) { _nc_warning("tic-expansion of %s failed", name); } else if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) { diff --git a/test/knight.c b/test/knight.c index 0d6675e5..50cba37f 100644 --- a/test/knight.c +++ b/test/knight.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * + * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.44 2018/05/12 13:23:24 tom Exp $ + * $Id: knight.c,v 1.45 2019/04/20 20:34:55 tom Exp $ */ #include @@ -75,7 +75,9 @@ static WINDOW *boardwin; /* the board window */ static WINDOW *helpwin; /* the help window */ static WINDOW *msgwin; /* the message window */ +#if HAVE_USE_DEFAULT_COLORS static bool d_option; +#endif static chtype minus = '-'; /* possible-move character */ static chtype oldch; diff --git a/test/ncurses.c b/test/ncurses.c index c5188e51..9088f96f 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.514 2019/01/21 20:15:28 tom Exp $ +$Id: ncurses.c,v 1.515 2019/04/20 20:34:11 tom Exp $ ***************************************************************************/ @@ -7876,7 +7876,7 @@ main(int argc, char *argv[]) { int c; int my_e_param = 1; -#ifdef NCURSES_VERSION +#if HAVE_USE_DEFAULT_COLORS int default_fg = COLOR_WHITE; int default_bg = COLOR_BLACK; bool assumed_colors = FALSE; @@ -7892,7 +7892,7 @@ main(int argc, char *argv[]) while ((c = getopt(argc, argv, "a:dEe:fhmp:s:Tt:x")) != -1) { switch (c) { -#ifdef NCURSES_VERSION +#if HAVE_USE_DEFAULT_COLORS case 'a': assumed_colors = TRUE; switch (sscanf(optarg, "%d,%d", &default_fg, &default_bg)) { diff --git a/test/picsmap.c b/test/picsmap.c index 6ca7c6d4..dd33d78c 100644 --- a/test/picsmap.c +++ b/test/picsmap.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: picsmap.c,v 1.128 2019/02/02 20:03:13 tom Exp $ + * $Id: picsmap.c,v 1.129 2019/04/20 20:33:51 tom Exp $ * * Author: Thomas E. Dickey * @@ -1449,6 +1449,7 @@ dump_picture(PICS_HEAD * pics) static void init_display(const char *palette_path, int opt_d) { + (void) opt_d; if (isatty(fileno(stdout))) { in_curses = TRUE; initscr(); diff --git a/test/test.priv.h b/test/test.priv.h index 5f6f341c..b9c5dc65 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.181 2019/04/13 22:54:18 tom Exp $ */ +/* $Id: test.priv.h,v 1.182 2019/04/20 20:15:39 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -733,12 +733,37 @@ extern "C" { #define _nc_SLIMIT(n) /* nothing */ #endif +/* + * X/Open Curses does not define the arrays of terminfo/termcap names as SVr4 + * curses did, and some implementations provide them anyway, but undeclared. + */ #ifdef DECL_CURSES_DATA_BOOLNAMES extern char *boolnames[], *boolcodes[], *boolfnames[]; extern char *numnames[], *numcodes[], *numfnames[]; extern char *strnames[], *strcodes[], *strfnames[]; #endif +/* + * Again, an SVr4 curses feature latent in the libraries but not in headers. + */ +#ifndef DECL_CURSES_DATA_TABSIZE +#define DECL_CURSES_DATA_TABSIZE 0 +#endif + +#if DECL_CURSES_DATA_TABSIZE +extern int TABSIZE; +#undef HAVE_CURSES_DATA_TABSIZE +#define HAVE_CURSES_DATA_TABSIZE 1 +#endif + +#ifndef HAVE_CURSES_DATA_TABSIZE +#define HAVE_CURSES_DATA_TABSIZE 0 +#endif + +/* + * X/Open Curses provides termname(), whose return value is analogous to the + * SVr4 curses variable ttytype[]. + */ #ifndef HAVE_CURSES_DATA_TTYTYPE #define HAVE_CURSES_DATA_TTYTYPE 0 #endif -- 2.44.0