From: Thomas E. Dickey Date: Sun, 7 Nov 2021 00:20:43 +0000 (+0000) Subject: ncurses 6.3 - patch 20211106 X-Git-Tag: v6.4~62 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=f399f54c6c4ea2143afcbf704ce9af0be52b63fc ncurses 6.3 - patch 20211106 + improve check in misc/Makefile.in for empty $PKG_CONFIG_LIBDIR + modify wnoutrefresh to call pnoutrefresh if its parameter is a pad, rather than treating it as an error, and modify new_panel to permit its window-parameter to be a pad (report by Giorgos Xou). + fix a memory-leak in del_curterm (prompted by discussion with Bram Moolenaar, cf: 20210821). --- diff --git a/NEWS b/NEWS index 48304825..10b88172 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.3738 2021/10/31 00:31:12 tom Exp $ +-- $Id: NEWS,v 1.3741 2021/11/06 23:43:40 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,14 @@ 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. +20211106 + + improve check in misc/Makefile.in for empty $PKG_CONFIG_LIBDIR + + modify wnoutrefresh to call pnoutrefresh if its parameter is a pad, + rather than treating it as an error, and modify new_panel to permit + its window-parameter to be a pad (report by Giorgos Xou). + + fix a memory-leak in del_curterm (prompted by discussion with Bram + Moolenaar, cf: 20210821). + 20211030 + simplify some references to WINDOWS._flags using macros. + add a "check" rule in Ada95 makefile, to help with test-packages. diff --git a/VERSION b/VERSION index e0abb8e8..98fece81 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.3 20211030 +5:0:10 6.3 20211106 diff --git a/dist.mk b/dist.mk index 2bb8d59f..dba6c9e1 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.1447 2021/10/30 08:33:19 tom Exp $ +# $Id: dist.mk,v 1.1448 2021/11/06 08:19:47 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 = 3 -NCURSES_PATCH = 20211030 +NCURSES_PATCH = 20211106 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/misc/Makefile.in b/misc/Makefile.in index befbb028..1539973f 100644 --- a/misc/Makefile.in +++ b/misc/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.78 2021/07/03 19:07:50 tom Exp $ +# $Id: Makefile.in,v 1.79 2021/11/06 23:36:12 tom Exp $ ############################################################################## # Copyright 2018-2020,2021 Thomas E. Dickey # # Copyright 1998-2016,2017 Free Software Foundation, Inc. # @@ -147,7 +147,7 @@ install.libs :: $(DESTDIR)$(bindir) ncurses-config # directory during this rule: @MAKE_PC_FILES@install \ @MAKE_PC_FILES@install.libs :: pc-files -@MAKE_PC_FILES@ @$(SHELL) -c 'case "x$(DESTDIR)$(PKG_CONFIG_LIBDIR)" in \ +@MAKE_PC_FILES@ @$(SHELL) -c 'case "x$(PKG_CONFIG_LIBDIR)" in \ @MAKE_PC_FILES@ x/*) \ @MAKE_PC_FILES@ mkdir -p $(DESTDIR)$(PKG_CONFIG_LIBDIR); \ @MAKE_PC_FILES@ for name in $(PC_FILES); do \ diff --git a/ncurses/base/lib_delwin.c b/ncurses/base/lib_delwin.c index 2f0621cf..efaf4ee1 100644 --- a/ncurses/base/lib_delwin.c +++ b/ncurses/base/lib_delwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,24 +43,28 @@ #include -MODULE_ID("$Id: lib_delwin.c,v 1.21 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_delwin.c,v 1.22 2021/11/06 21:54:14 tom Exp $") static bool cannot_delete(WINDOW *win) { WINDOWLIST *p; bool result = TRUE; + if (IS_PAD(win)) { + result = FALSE; + } else { #ifdef USE_SP_WINDOWLIST - SCREEN *sp = _nc_screen_of(win); + SCREEN *sp = _nc_screen_of(win); #endif - for (each_window(SP_PARM, p)) { - if (&(p->win) == win) { - result = FALSE; - } else if ((p->win._flags & _SUBWIN) != 0 - && p->win._parent == win) { - result = TRUE; - break; + for (each_window(SP_PARM, p)) { + if (&(p->win) == win) { + result = FALSE; + } else if (IS_SUBWIN(&(p->win)) + && p->win._parent == win) { + result = TRUE; + break; + } } } return result; @@ -77,15 +81,18 @@ delwin(WINDOW *win) if (win == 0 || cannot_delete(win)) { result = ERR; + } else if (IS_PAD(win)) { + win->_parent = NULL; + result = OK; } else { #if NCURSES_SP_FUNCS SCREEN *sp = _nc_screen_of(win); #endif - if (win->_flags & _SUBWIN) + if (IS_SUBWIN(win)) { touchwin(win->_parent); - else if (CurScreen(SP_PARM) != 0) + } else if (CurScreen(SP_PARM) != 0) { touchwin(CurScreen(SP_PARM)); - + } result = _nc_freewin(win); } _nc_unlock_global(curses); diff --git a/ncurses/base/lib_freeall.c b/ncurses/base/lib_freeall.c index 7af8c30a..75bbe77e 100644 --- a/ncurses/base/lib_freeall.c +++ b/ncurses/base/lib_freeall.c @@ -40,7 +40,7 @@ extern int malloc_errfd; /* FIXME */ #endif -MODULE_ID("$Id: lib_freeall.c,v 1.75 2021/10/23 18:53:46 tom Exp $") +MODULE_ID("$Id: lib_freeall.c,v 1.76 2021/11/06 21:52:49 tom Exp $") /* * Free all ncurses data. This is used for testing only (there's no practical @@ -78,6 +78,9 @@ NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0) WINDOW *p_win = &(p->win); bool found = FALSE; + if (IS_PAD(p_win)) + continue; + #ifndef USE_SP_WINDOWLIST if (p->screen != SP_PARM) continue; diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c index d8444289..4579cbf8 100644 --- a/ncurses/base/lib_refresh.c +++ b/ncurses/base/lib_refresh.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,7 +43,7 @@ #include -MODULE_ID("$Id: lib_refresh.c,v 1.46 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.47 2021/11/06 22:22:03 tom Exp $") NCURSES_EXPORT(int) wrefresh(WINDOW *win) @@ -92,13 +92,21 @@ wnoutrefresh(WINDOW *win) T((T_CALLED("wnoutrefresh(%p)"), (void *) win)); - /* - * This function will break badly if we try to refresh a pad. - */ - if ((win == 0) - || (win->_flags & _ISPAD)) + if (win == NULL) returnCode(ERR); + /* + * Handle pads as a special case. + */ + if (IS_PAD(win)) { + returnCode(pnoutrefresh(win, + win->_pad._pad_y, + win->_pad._pad_x, + win->_pad._pad_top, + win->_pad._pad_left, + win->_pad._pad_bottom, + win->_pad._pad_right)); + } #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { _tracedump("...win", win); diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 0373aebb..b1303d6d 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -41,7 +41,7 @@ #include /* ospeed */ #include /* VALID_STRING */ -MODULE_ID("$Id: lib_cur_term.c,v 1.43 2020/10/24 18:54:32 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.44 2021/11/06 19:04:21 tom Exp $") #undef CUR #define CUR TerminalType(termp). @@ -167,10 +167,13 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL *termp) /* discard memory used in tgetent's cache for this terminal */ _nc_tgetent_leak(termp); #endif + free(termp->tparm_state.fmt_buff); + free(termp->tparm_state.out_buff); free(termp); rc = OK; } + returnCode(rc); } diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 02f4db04..1cbd0a7c 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20211030) unstable; urgency=low +ncurses6 (6.3+20211106) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 30 Oct 2021 04:33:19 -0400 + -- Thomas E. Dickey Sat, 06 Nov 2021 04:19:47 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 02f4db04..1cbd0a7c 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20211030) unstable; urgency=low +ncurses6 (6.3+20211106) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 30 Oct 2021 04:33:19 -0400 + -- Thomas E. Dickey Sat, 06 Nov 2021 04:19:47 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 6e0d5416..52fb2d95 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20211030) unstable; urgency=low +ncurses6 (6.3+20211106) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 30 Oct 2021 04:33:19 -0400 + -- Thomas E. Dickey Sat, 06 Nov 2021 04:19:47 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 632ca430..a9c30c3d 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.489 2021/10/30 08:33:19 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.490 2021/11/06 08:19:47 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "3" !define VERSION_YYYY "2021" -!define VERSION_MMDD "1030" +!define VERSION_MMDD "1106" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index ff79d856..f0070dca 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.3 -Release: 20211030 +Release: 20211106 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 80c2e648..e71bfbce 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.3 -Release: 20211030 +Release: 20211106 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 7fd67829..dcc95605 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.3 -Release: 20211030 +Release: 20211106 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/panel/p_new.c b/panel/p_new.c index 37f851da..cf116403 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -39,7 +39,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.23 2021/06/17 21:20:30 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.24 2021/10/23 15:12:06 tom Exp $") #ifdef TRACE static char *stdscr_id; @@ -117,7 +117,7 @@ new_panel(WINDOW *win) (void)root_panel(NCURSES_SP_ARG); assert(_nc_stdscr_pseudo_panel); - if (!(win->_flags & _ISPAD) && (pan = AllocPanel("new_panel"))) + if ((pan = AllocPanel("new_panel")) != NULL) { pan->win = win; pan->above = (PANEL *)0;