From: Thomas E. Dickey Date: Sun, 25 Apr 2021 01:07:00 +0000 (+0000) Subject: ncurses 6.2 - patch 20210424 X-Git-Tag: v6.3~28 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=312665d3aaaf5d8e3ba34d80fdd650abf758272a ncurses 6.2 - patch 20210424 + avoid using broken system macros for snprintf which interfere with _nc_SLIMIT's conditionally adding a parameter when the string-hacks configure option is enabled. + add a "all::" rule before the new "check" rule in test/Makefile.in --- diff --git a/NEWS b/NEWS index 42fadc11..2312f94b 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.3656 2021/04/18 18:13:32 tom Exp $ +-- $Id: NEWS,v 1.3658 2021/04/25 00:04:11 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. +20210424 + + avoid using broken system macros for snprintf which interfere with + _nc_SLIMIT's conditionally adding a parameter when the string-hacks + configure option is enabled. + + add a "all::" rule before the new "check" rule in test/Makefile.in + 20210418 + improve CF_LINK_FUNCS by ensuring that the source-file is closed before linking to the target. diff --git a/VERSION b/VERSION index 5f83cc00..21c2b086 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.2 20210418 +5:0:10 6.2 20210424 diff --git a/dist.mk b/dist.mk index 0a7b40bc..30058a6c 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.1411 2021/04/18 10:23:11 tom Exp $ +# $Id: dist.mk,v 1.1412 2021/04/24 10:46:30 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 = 20210418 +NCURSES_PATCH = 20210424 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/nc_string.h b/include/nc_string.h index 93cf2015..546aa069 100644 --- a/include/nc_string.h +++ b/include/nc_string.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2012-2013,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -41,7 +41,7 @@ #endif /* - * $Id: nc_string.h,v 1.8 2020/02/02 23:34:34 tom Exp $ + * $Id: nc_string.h,v 1.9 2021/04/25 00:10:43 tom Exp $ * * String-hacks. Use these macros to stifle warnings on (presumably) correct * uses of strcat, strcpy and sprintf. @@ -76,7 +76,11 @@ #endif #if USE_STRING_HACKS && HAVE_SNPRINTF +#ifdef __cplusplus #define _nc_SPRINTF NCURSES_VOID snprintf +#else +#define _nc_SPRINTF NCURSES_VOID (snprintf) +#endif #define _nc_SLIMIT(n) NCURSES_CAST(size_t,n), #else #define _nc_SPRINTF NCURSES_VOID sprintf diff --git a/ncurses/tinfo/doalloc.c b/ncurses/tinfo/doalloc.c index 0bda12ca..e3b1a2e9 100644 --- a/ncurses/tinfo/doalloc.c +++ b/ncurses/tinfo/doalloc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2002,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -40,15 +40,18 @@ #include -MODULE_ID("$Id: doalloc.c,v 1.13 2020/08/30 00:27:15 tom Exp $") +MODULE_ID("$Id: doalloc.c,v 1.14 2021/04/24 23:43:39 tom Exp $") void * _nc_doalloc(void *oldp, size_t amount) { void *newp; - if (oldp != 0) { - if ((newp = realloc(oldp, amount)) == 0) { + if (oldp != NULL) { + if (amount == 0) { + free(oldp); + newp = NULL; + } else if ((newp = realloc(oldp, amount)) == 0) { free(oldp); errno = ENOMEM; /* just in case 'free' reset */ } diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 82e09ba9..91ef62c2 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20210418) unstable; urgency=low +ncurses6 (6.2+20210424) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 18 Apr 2021 06:23:11 -0400 + -- Thomas E. Dickey Sat, 24 Apr 2021 06:46:29 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 82e09ba9..91ef62c2 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20210418) unstable; urgency=low +ncurses6 (6.2+20210424) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 18 Apr 2021 06:23:11 -0400 + -- Thomas E. Dickey Sat, 24 Apr 2021 06:46:29 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 047a2564..4f24291c 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.2+20210418) unstable; urgency=low +ncurses6 (6.2+20210424) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 18 Apr 2021 06:23:11 -0400 + -- Thomas E. Dickey Sat, 24 Apr 2021 06:46:29 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 023ace7b..bbb9d8c3 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.454 2021/04/18 10:23:11 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.455 2021/04/24 10:46:30 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 "0418" +!define VERSION_MMDD "0424" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 0b311c71..803a6458 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: 20210418 +Release: 20210424 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 8ded1c57..6c116708 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: 20210418 +Release: 20210424 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index e8c19006..84c32768 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: 20210418 +Release: 20210424 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/Makefile.in b/test/Makefile.in index e6edb9a6..39806522 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.127 2021/04/18 11:48:06 tom Exp $ +# $Id: Makefile.in,v 1.128 2021/04/24 23:10:15 tom Exp $ ############################################################################## # Copyright 2020,2021 Thomas E. Dickey # # Copyright 1998-2017,2018 Free Software Foundation, Inc. # @@ -153,6 +153,8 @@ HEADER_DEPS = \ $(incdir)/unctrl.h \ $(INCDIR)/nc_alloc.h +all:: + # Verify that each header-file can be compiled without including another. check:: @$(SHELL) -c "for header in *.h;\ diff --git a/test/color_name.h b/test/color_name.h index d27804e8..867396ca 100644 --- a/test/color_name.h +++ b/test/color_name.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 2011-2012,2016 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: color_name.h,v 1.8 2020/06/20 18:58:20 tom Exp $ + * $Id: color_name.h,v 1.9 2021/04/24 23:25:29 tom Exp $ */ #ifndef __COLORNAME_H @@ -37,7 +37,7 @@ #include #endif -static NCURSES_CONST char *the_color_names[] = +static NCURSES_CONST char *const the_color_names[] = { "black", "red", diff --git a/test/knight.c b/test/knight.c index bda7da38..f9f725b0 100644 --- a/test/knight.c +++ b/test/knight.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2020,2021 Thomas E. Dickey * * Copyright 1998-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -34,7 +34,7 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.47 2020/02/02 23:34:34 tom Exp $ + * $Id: knight.c,v 1.48 2021/04/25 00:10:43 tom Exp $ */ #include @@ -595,8 +595,8 @@ play(void) { bool keyhelp; /* TRUE if keystroke help is up */ int i, j, count; - int lastcol = 0; /* last location visited */ - int lastrow = 0; + int lastcol; /* last location visited */ + int lastrow; int ny = 0, nx = 0; int review = 0; /* review history */ int test_size; diff --git a/test/mk-test.awk b/test/mk-test.awk index 25b37381..cf3066fa 100644 --- a/test/mk-test.awk +++ b/test/mk-test.awk @@ -1,4 +1,4 @@ -# $Id: mk-test.awk,v 1.24 2021/04/18 11:49:55 tom Exp $ +# $Id: mk-test.awk,v 1.25 2021/04/24 23:10:40 tom Exp $ ############################################################################## # Copyright 2019-2020,2021 Thomas E. Dickey # # Copyright 2006-2017,2018 Free Software Foundation, Inc. # @@ -77,7 +77,7 @@ END { print " $(srcdir)/*.x* \\" print " $(srcdir)/*.dat" print "" - print "all: $(TESTS)" + print "all:: $(TESTS)" print "" print "sources:" print "" diff --git a/test/picsmap.h b/test/picsmap.h index bdeb3c31..fc790a94 100644 --- a/test/picsmap.h +++ b/test/picsmap.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -30,7 +30,7 @@ /**************************************************************************** * Author: Thomas E. Dickey * ****************************************************************************/ -/* $Id: picsmap.h,v 1.4 2020/02/02 23:34:34 tom Exp $ */ +/* $Id: picsmap.h,v 1.5 2021/04/24 23:25:17 tom Exp $ */ #ifndef PICSMAP_H_INCL #define PICSMAP_H_INCL 1 @@ -68,8 +68,4 @@ typedef struct { short blue; } RGB_DATA; -static void init_display(const char *, int); - -static void show_picture(PICS_HEAD * pics); - #endif /* PICSMAP_H_INCL */ diff --git a/test/test.priv.h b/test/test.priv.h index 924b297d..58f79e00 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -30,7 +30,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.196 2021/03/20 19:02:18 tom Exp $ */ +/* $Id: test.priv.h,v 1.197 2021/04/25 00:00:24 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -748,10 +748,10 @@ extern "C" { #endif #if USE_STRING_HACKS && HAVE_SNPRINTF -#define _nc_SPRINTF NCURSES_VOID snprintf +#define _nc_SPRINTF NCURSES_VOID (snprintf) #define _nc_SLIMIT(n) NCURSES_CAST(size_t,n), #else -#define _nc_SPRINTF NCURSES_VOID sprintf +#define _nc_SPRINTF NCURSES_VOID (sprintf) #define _nc_SLIMIT(n) /* nothing */ #endif diff --git a/test/test_vid_puts.c b/test/test_vid_puts.c index 85a7f4ed..1259ebf2 100644 --- a/test/test_vid_puts.c +++ b/test/test_vid_puts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2013-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_vid_puts.c,v 1.11 2020/02/02 23:34:34 tom Exp $ + * $Id: test_vid_puts.c,v 1.12 2021/04/25 00:10:43 tom Exp $ * * Demonstrate the vid_puts and vid_attr functions. * Thomas Dickey - 2013/01/12 @@ -44,7 +44,7 @@ static bool p_opt = FALSE; static TPUTS_PROTO(outc, c) { - int rc = c; + int rc; rc = putc(c, my_fp); TPUTS_RETURN(rc); diff --git a/test/test_vidputs.c b/test/test_vidputs.c index 355f1009..25b7714d 100644 --- a/test/test_vidputs.c +++ b/test/test_vidputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2013-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_vidputs.c,v 1.10 2020/02/02 23:34:34 tom Exp $ + * $Id: test_vidputs.c,v 1.11 2021/04/25 00:10:43 tom Exp $ * * Demonstrate the vidputs and vidattr functions. * Thomas Dickey - 2013/01/12 @@ -44,7 +44,7 @@ static bool p_opt = FALSE; static TPUTS_PROTO(outc, c) { - int rc = c; + int rc; rc = putc(c, my_fp); TPUTS_RETURN(rc);