From aed072e27e60c2abc5ac0ab8113aacf9b4908d50 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sat, 23 Dec 2017 23:06:29 +0000 Subject: [PATCH] ncurses 6.0 - patch 20171223 + modify ncurses-examples to quiet const-warnings when building with PDCurses. + modify toe to not exit if unable to read a terminal description, e.g., if there is a permission problem. + minor fix for progs/toe.c, using _nc_free_termtype2. + assign 0 to pointer in _nc_tgetent_leak() after freeing it. Also avoid reusing pointer from previous successful call to tgetent if the latest call is unsuccessful (patch by Michael Schroeder, OpenSuSE #1070450). + minor fix for test/tracemunch, initialize $awaiting variable. --- NEWS | 14 +++++++++++++- VERSION | 2 +- dist.mk | 4 ++-- ncurses/tinfo/lib_termcap.c | 12 ++++++++---- 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 +- progs/toe.c | 9 +++------ test/movewindow.c | 4 ++-- test/test.priv.h | 8 ++++++-- test/testcurs.c | 4 ++-- test/tracemunch | 4 ++-- 15 files changed, 49 insertions(+), 32 deletions(-) diff --git a/NEWS b/NEWS index b6957142..aca9d158 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.3025 2017/12/17 00:14:16 tom Exp $ +-- $Id: NEWS,v 1.3030 2017/12/23 21:44:36 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,18 @@ 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. +20171223 + + modify ncurses-examples to quiet const-warnings when building with + PDCurses. + + modify toe to not exit if unable to read a terminal description, + e.g., if there is a permission problem. + + minor fix for progs/toe.c, using _nc_free_termtype2. + + assign 0 to pointer in _nc_tgetent_leak() after freeing it. Also + avoid reusing pointer from previous successful call to tgetent + if the latest call is unsuccessful (patch by Michael Schroeder, + OpenSuSE #1070450). + + minor fix for test/tracemunch, initialize $awaiting variable. + 20171216 + repair template in test/package/ncurses-examples.spec (cf: 20171111). + improve tic's warning about the number of parameters tparm might use diff --git a/VERSION b/VERSION index 19de6ac4..ae56f4f3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20171216 +5:0:9 6.0 20171223 diff --git a/dist.mk b/dist.mk index 7bca63ee..526040fa 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.1196 2017/12/11 01:17:12 tom Exp $ +# $Id: dist.mk,v 1.1197 2017/12/17 20:03:11 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 = 0 -NCURSES_PATCH = 20171216 +NCURSES_PATCH = 20171223 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index a8addc6c..ebad5814 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -48,7 +48,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_termcap.c,v 1.84 2017/04/11 01:15:11 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.86 2017/12/23 18:18:13 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -153,8 +153,12 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) } CacheInx = best; } - LAST_TRM = TerminalOf(SP_PARM); - LAST_SEQ = ++CacheSeq; + if (rc == 1) { + LAST_TRM = TerminalOf(SP_PARM); + LAST_SEQ = ++CacheSeq; + } else { + LAST_TRM = 0; + } PC = 0; UP = 0; @@ -401,7 +405,7 @@ _nc_tgetent_leak(TERMINAL *termp) int num; for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) { if (LAST_TRM == termp) { - FreeIfNeeded(FIX_SGR0); + FreeAndNull(FIX_SGR0); if (LAST_TRM != 0) { LAST_TRM = 0; } diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index fa1baa69..b1b43325 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20171216) unstable; urgency=low +ncurses6 (6.0+20171223) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 10 Dec 2017 20:17:12 -0500 + -- Thomas E. Dickey Sun, 17 Dec 2017 15:03:11 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index fa1baa69..b1b43325 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20171216) unstable; urgency=low +ncurses6 (6.0+20171223) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 10 Dec 2017 20:17:12 -0500 + -- Thomas E. Dickey Sun, 17 Dec 2017 15:03:11 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index dbeeb14e..3312d205 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20171216) unstable; urgency=low +ncurses6 (6.0+20171223) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 10 Dec 2017 20:17:12 -0500 + -- Thomas E. Dickey Sun, 17 Dec 2017 15:03:11 -0500 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index b694cb97..e841a596 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.244 2017/12/11 01:17:12 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.245 2017/12/17 20:03:11 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "0" !define VERSION_YYYY "2017" -!define VERSION_MMDD "1216" +!define VERSION_MMDD "1223" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 2f78a8e0..182c3107 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.0 -Release: 20171216 +Release: 20171223 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 90286872..75624e25 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.0 -Release: 20171216 +Release: 20171223 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/progs/toe.c b/progs/toe.c index 030230dc..5abb46de 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: toe.c,v 1.75 2017/04/05 23:19:24 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.77 2017/12/23 19:23:40 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -440,11 +440,8 @@ typelist(int eargc, char *eargv[], (void) fprintf(stderr, "%s: couldn't open terminfo file %s.\n", _nc_progname, name_2); - free(cwd_buf); free(name_2); - closedir(entrydir); - closedir(termdir); - return (EXIT_FAILURE); + continue; } /* only visit things once, by primary name */ @@ -489,7 +486,7 @@ typelist(int eargc, char *eargv[], cn = _nc_first_name(lterm.term_names); /* apply the selected hook function */ hook(i, eargc, cn, <erm); - _nc_free_termtype(<erm); + _nc_free_termtype2(<erm); } } code = _nc_db_next(capdbp, &key, &data); diff --git a/test/movewindow.c b/test/movewindow.c index 285d92ef..b8e9e049 100644 --- a/test/movewindow.c +++ b/test/movewindow.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: movewindow.c,v 1.45 2017/09/06 20:08:11 tom Exp $ + * $Id: movewindow.c,v 1.46 2017/12/23 21:36:59 tom Exp $ * * Demonstrate move functions for windows and derived windows from the curses * library. @@ -54,7 +54,7 @@ TODO: #undef derwin #endif -#ifdef NCURSES_VERSION +#if defined(NCURSES_VERSION) || defined(PDCURSES) #define CONST_FMT const #else #define CONST_FMT /* nothing */ diff --git a/test/test.priv.h b/test/test.priv.h index c2b4bd46..fbc1fdb3 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.160 2017/10/12 01:00:59 tom Exp $ */ +/* $Id: test.priv.h,v 1.161 2017/12/23 21:40:21 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -887,8 +887,12 @@ extern char *strnames[], *strcodes[], *strfnames[]; * that XSI shows. */ #ifndef NCURSES_CONST +#ifdef PDCURSES +#define NCURSES_CONST const /* close enough */ +#else #define NCURSES_CONST /* nothing */ #endif +#endif /* out-of-band values for representing absent capabilities */ #define ABSENT_BOOLEAN ((signed char)-1) /* 255 */ @@ -974,7 +978,7 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */ /* * ncurses uses const in some places where X/Open does (or did) not allow. */ -#ifdef NCURSES_VERSION +#if defined(NCURSES_VERSION) || defined(PDCURSES) #define CONST_MENUS const #else #define CONST_MENUS /* nothing */ diff --git a/test/testcurs.c b/test/testcurs.c index 0a90d817..fd3431ce 100644 --- a/test/testcurs.c +++ b/test/testcurs.c @@ -6,13 +6,13 @@ * wrs(5/28/93) -- modified to be consistent (perform identically) with either * PDCurses or under Unix System V, R4 * - * $Id: testcurs.c,v 1.52 2017/09/04 11:49:55 tom Exp $ + * $Id: testcurs.c,v 1.53 2017/12/23 21:38:26 tom Exp $ */ #include #if defined(XCURSES) -char *XCursesProgramName = "testcurs"; +const char *XCursesProgramName = "testcurs"; #endif static int initTest(WINDOW **); diff --git a/test/tracemunch b/test/tracemunch index b33b7d59..1c931432 100755 --- a/test/tracemunch +++ b/test/tracemunch @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: tracemunch,v 1.16 2017/08/09 23:59:00 tom Exp $ +# $Id: tracemunch,v 1.17 2017/12/23 17:51:31 tom Exp $ ############################################################################## # Copyright (c) 1998-2005,2017 Free Software Foundation, Inc. # # # @@ -92,7 +92,7 @@ sub transaddr { while () { my $addr; my $n; - my $awaiting; + my $awaiting = ""; CLASSIFY: { -- 2.44.0