Skip to content

Commit

Permalink
ncurses 6.3 - patch 20211106
Browse files Browse the repository at this point in the history
+ 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).
  • Loading branch information
ThomasDickey committed Nov 7, 2021
1 parent 63d2670 commit f399f54
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 42 deletions.
10 changes: 9 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5:0:10 6.3 20211030
5:0:10 6.3 20211106
4 changes: 2 additions & 2 deletions dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions misc/Makefile.in
Original file line number Diff line number Diff line change
@@ -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. #
Expand Down Expand Up @@ -147,7 +147,7 @@ install.libs :: $(DESTDIR)$(bindir) ncurses-config
# directory during this rule:
@MAKE_PC_FILES@install \
@[email protected] :: 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 \
Expand Down
33 changes: 20 additions & 13 deletions ncurses/base/lib_delwin.c
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -43,24 +43,28 @@

#include <curses.priv.h>

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;
Expand All @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion ncurses/base/lib_freeall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
22 changes: 15 additions & 7 deletions ncurses/base/lib_refresh.c
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -43,7 +43,7 @@

#include <curses.priv.h>

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)
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions ncurses/tinfo/lib_cur_term.c
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -41,7 +41,7 @@
#include <termcap.h> /* ospeed */
#include <tic.h> /* 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).
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions package/debian-mingw/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ncurses6 (6.3+20211030) unstable; urgency=low
ncurses6 (6.3+20211106) unstable; urgency=low

* latest weekly patch

-- Thomas E. Dickey <[email protected]> Sat, 30 Oct 2021 04:33:19 -0400
-- Thomas E. Dickey <[email protected]> Sat, 06 Nov 2021 04:19:47 -0400

ncurses6 (5.9-20131005) unstable; urgency=low

Expand Down
4 changes: 2 additions & 2 deletions package/debian-mingw64/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ncurses6 (6.3+20211030) unstable; urgency=low
ncurses6 (6.3+20211106) unstable; urgency=low

* latest weekly patch

-- Thomas E. Dickey <[email protected]> Sat, 30 Oct 2021 04:33:19 -0400
-- Thomas E. Dickey <[email protected]> Sat, 06 Nov 2021 04:19:47 -0400

ncurses6 (5.9-20131005) unstable; urgency=low

Expand Down
4 changes: 2 additions & 2 deletions package/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ncurses6 (6.3+20211030) unstable; urgency=low
ncurses6 (6.3+20211106) unstable; urgency=low

* latest weekly patch

-- Thomas E. Dickey <[email protected]> Sat, 30 Oct 2021 04:33:19 -0400
-- Thomas E. Dickey <[email protected]> Sat, 06 Nov 2021 04:19:47 -0400

ncurses6 (5.9-20120608) unstable; urgency=low

Expand Down
4 changes: 2 additions & 2 deletions package/mingw-ncurses.nsi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion package/mingw-ncurses.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package/ncurses.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package/ncursest.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions panel/p_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f399f54

Please sign in to comment.