From fe8c285d2a2770ee40523303dbf27a9fd8d01188 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 27 Jan 2019 02:01:01 +0000 Subject: [PATCH] ncurses 6.1 - patch 20190126 + change some "%define" statements in test-packages for RPMs to "%global" to work around changes in rpm 4.14 from recent Redhat. + fixes for O_INPUT_FIELD extension (patch by Leon Winter). + eliminate fixed buffer-size when reading $TERMCAP variable. + correct logic in read_entry.c which prevented $TERMCAP variable from being interpreted as a fallback to terminfo entry (prompted by Savannah #54556, cf: 20110924). --- NEWS | 11 ++++++++++- VERSION | 2 +- dist.mk | 4 ++-- form/fld_max.c | 6 ++++-- form/form.priv.h | 7 ++++--- ncurses/tinfo/read_entry.c | 4 ++-- ncurses/tinfo/read_termcap.c | 24 ++++++++++++++---------- 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/package/mingw-ncurses-examples.spec | 8 ++++---- test/package/ncurses-examples.spec | 10 +++++----- test/view.c | 6 +++--- 17 files changed, 60 insertions(+), 44 deletions(-) diff --git a/NEWS b/NEWS index 00c1203c..732995ad 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.3261 2019/01/21 22:51:52 tom Exp $ +-- $Id: NEWS,v 1.3266 2019/01/27 00:23:49 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,15 @@ 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. +20190126 + + change some "%define" statements in test-packages for RPMs to + "%global" to work around changes in rpm 4.14 from recent Redhat. + + fixes for O_INPUT_FIELD extension (patch by Leon Winter). + + eliminate fixed buffer-size when reading $TERMCAP variable. + + correct logic in read_entry.c which prevented $TERMCAP variable from + being interpreted as a fallback to terminfo entry (prompted by + Savannah #54556, cf: 20110924). + 20190121 + add a check in test/configure to work around non-ncurses termcap.h file in Slackware. diff --git a/VERSION b/VERSION index b0a98d5e..53a630cd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20190121 +5:0:10 6.1 20190126 diff --git a/dist.mk b/dist.mk index 360f5355..5daa0e25 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.1263 2019/01/21 01:57:34 tom Exp $ +# $Id: dist.mk,v 1.1264 2019/01/22 23:47:52 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 = 20190121 +NCURSES_PATCH = 20190126 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/fld_max.c b/form/fld_max.c index fc00bc21..510c3f1c 100644 --- a/form/fld_max.c +++ b/form/fld_max.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_max.c,v 1.14 2019/01/19 21:26:06 Leon.Winter Exp $") +MODULE_ID("$Id: fld_max.c,v 1.15 2019/01/26 22:18:08 Leon.Winter Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -63,7 +63,9 @@ set_max_field(FIELD *field, int maxgrow) RETURN(E_BAD_ARGUMENT); } field->maxgrow = maxgrow; - if (Field_Has_Option(field, O_INPUT_LIMIT) && field->dcols > maxgrow) + /* shrink */ + if (maxgrow > 0 && Field_Has_Option(field, O_INPUT_LIMIT) && + field->dcols > maxgrow) field->dcols = maxgrow; ClrStatus(field, _MAY_GROW); if (!((unsigned)field->opts & O_STATIC)) diff --git a/form/form.priv.h b/form/form.priv.h index e48a9f26..c434dacc 100644 --- a/form/form.priv.h +++ b/form/form.priv.h @@ -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 * @@ -30,7 +30,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: form.priv.h,v 0.43 2018/04/14 21:06:14 Leon.Winter Exp $ */ +/* $Id: form.priv.h,v 0.44 2019/01/26 22:17:48 Leon.Winter Exp $ */ #ifndef FORM_PRIV_H #define FORM_PRIV_H 1 @@ -167,7 +167,8 @@ TypeArgument; STD_FIELD_OPTS |\ O_DYNAMIC_JUSTIFY |\ O_NO_LEFT_STRIP |\ - O_EDGE_INSERT_STAY) + O_EDGE_INSERT_STAY |\ + O_INPUT_LIMIT) #define C_BLANK ' ' #define is_blank(c) ((c)==C_BLANK) diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index de953f4e..d4257982 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.152 2019/01/21 14:56:40 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.153 2019/01/23 00:02:04 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -821,7 +821,7 @@ _nc_read_tic_entry(char *filename, code = _nc_read_file_entry(filename, tp); } #if NCURSES_USE_TERMCAP - else if (code != TGETENT_YES) { + if (code != TGETENT_YES) { code = _nc_read_termcap_entry(name, tp); _nc_SPRINTF(filename, _nc_SLIMIT(PATH_MAX) "%.*s", PATH_MAX - 1, _nc_get_source()); diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index 6aafcb5e..ecf76d9b 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.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 * @@ -56,7 +56,7 @@ #include #include -MODULE_ID("$Id: read_termcap.c,v 1.96 2018/05/12 18:52:02 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.97 2019/01/26 20:07:30 tom Exp $") #if !PURE_TERMINFO @@ -965,6 +965,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) #endif #if USE_GETCAP char *p, tc[TBUFSIZ]; + char *tc_buf = 0; #define MY_SIZE sizeof(tc) - 1 int status; static char *source; @@ -983,8 +984,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) if (use_terminfo_vars() && (p = getenv("TERMCAP")) != 0 && !_nc_is_abs_path(p) && _nc_name_match(p, tn, "|:")) { /* TERMCAP holds a termcap entry */ - _nc_STRNCPY(tc, p, MY_SIZE); - tc[MY_SIZE] = '\0'; + tc_buf = strdup(p); _nc_set_source("TERMCAP"); } else { /* we're using getcap(3) */ @@ -993,8 +993,13 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) _nc_curr_line = lineno; _nc_set_source(source); + tc_buf = tc; } - _nc_read_entry_source((FILE *) 0, tc, FALSE, TRUE, NULLHOOK); + if (tc_buf == 0) + return (TGETENT_ERR); + _nc_read_entry_source((FILE *) 0, tc_buf, FALSE, TRUE, NULLHOOK); + if (tc_buf != tc) + free(tc_buf); #else /* * Here is what the 4.4BSD termcap(3) page prescribes: @@ -1028,7 +1033,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) int j, k; bool use_buffer = FALSE; bool normal = TRUE; - char tc_buf[1024]; + char *tc_buf = 0; char pathbuf[PATH_MAX]; char *copied = 0; char *cp; @@ -1040,10 +1045,8 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) ADD_TC(tc, 0); normal = FALSE; } else if (_nc_name_match(tc, tn, "|:")) { /* treat as a capability file */ - use_buffer = TRUE; - _nc_SPRINTF(tc_buf, - _nc_SLIMIT(sizeof(tc_buf)) - "%.*s\n", (int) sizeof(tc_buf) - 2, tc); + tc_buf = strdup(tc); + use_buffer = (tc_buf != 0); normal = FALSE; } } @@ -1112,6 +1115,7 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp) * that since it's just a single entry, they won't be a pain. */ _nc_read_entry_source((FILE *) 0, tc_buf, FALSE, FALSE, NULLHOOK); + free(tc_buf); } else { int i; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index b03c02a7..94cc35d3 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190121) unstable; urgency=low +ncurses6 (6.1+20190126) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 20 Jan 2019 20:57:34 -0500 + -- Thomas E. Dickey Tue, 22 Jan 2019 18:47:52 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index b03c02a7..94cc35d3 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190121) unstable; urgency=low +ncurses6 (6.1+20190126) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 20 Jan 2019 20:57:34 -0500 + -- Thomas E. Dickey Tue, 22 Jan 2019 18:47:52 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 3bc7a6d0..27121836 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190121) unstable; urgency=low +ncurses6 (6.1+20190126) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 20 Jan 2019 20:57:34 -0500 + -- Thomas E. Dickey Tue, 22 Jan 2019 18:47:52 -0500 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 4c4f9954..c9b4ba83 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.310 2019/01/21 01:57:34 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.311 2019/01/22 23:47:52 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 "0121" +!define VERSION_MMDD "0126" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 3ec5131e..936385a9 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: 20190121 +Release: 20190126 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 98157423..2acf8e47 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: 20190121 +Release: 20190126 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index d34a09a6..eb7c6093 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: 20190121 +Release: 20190126 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/package/mingw-ncurses-examples.spec b/test/package/mingw-ncurses-examples.spec index f26e652f..981a0de9 100644 --- a/test/package/mingw-ncurses-examples.spec +++ b/test/package/mingw-ncurses-examples.spec @@ -1,10 +1,10 @@ Summary: ncurses-examples - example/test programs from ncurses %?mingw_package_header -%define AppProgram ncurses-examples -%define AppVersion MAJOR.MINOR -%define AppRelease YYYYMMDD -# $Id: mingw-ncurses-examples.spec,v 1.7 2018/01/04 02:31:57 tom Exp $ +%global AppProgram ncurses-examples +%global AppVersion MAJOR.MINOR +%global AppRelease YYYYMMDD +# $Id: mingw-ncurses-examples.spec,v 1.8 2019/01/27 00:22:16 tom Exp $ Name: mingw32-ncurses6-examples Version: %{AppVersion} Release: %{AppRelease} diff --git a/test/package/ncurses-examples.spec b/test/package/ncurses-examples.spec index a3958cde..d912ea8b 100644 --- a/test/package/ncurses-examples.spec +++ b/test/package/ncurses-examples.spec @@ -1,9 +1,9 @@ Summary: example/test programs from ncurses -%define AppProgram ncurses-examples -%define AltProgram ncursest-examples -%define AppVersion MAJOR.MINOR -%define AppRelease YYYYMMDD -# $Id: ncurses-examples.spec,v 1.12 2018/06/02 22:46:44 tom Exp $ +%global AppProgram ncurses-examples +%global AltProgram ncursest-examples +%global AppVersion MAJOR.MINOR +%global AppRelease YYYYMMDD +# $Id: ncurses-examples.spec,v 1.13 2019/01/27 00:22:06 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: %{AppRelease} diff --git a/test/view.c b/test/view.c index bf4377f4..2772a277 100644 --- a/test/view.c +++ b/test/view.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 1998-2017,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 * @@ -51,7 +51,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.135 2017/10/23 09:18:01 tom Exp $ + * $Id: view.c,v 1.136 2019/01/27 00:52:06 tom Exp $ */ #include @@ -145,7 +145,7 @@ show_all(const char *tag) _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "view %.*s", (int) strlen(tag), tag); i = (int) strlen(temp); - _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - i) + _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i) " %.*s", (int) sizeof(temp) - i - 2, fname); move(0, 0); printw("%.*s", COLS, temp); -- 2.44.0