]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.3 - patch 20220813
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 14 Aug 2022 00:26:10 +0000 (00:26 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 14 Aug 2022 00:26:10 +0000 (00:26 +0000)
+ modify delscreen to more effectively delete all windows on the given
  screen.
+ amend portability note for delwin in manual page.
+ adapt test/test_delwin.c from example by Bill Gray.
+ account for prescreen data if freeing leaks in pthread-configuration
+ split-out _nc_set_read_thread(), to reduce compiler warnings about
  pthread_self(), which may/may not be a weak symbol.
+ improve pthread-configuration for test/worm.c

43 files changed:
MANIFEST
NEWS
VERSION
dist.mk
doc/html/man/adacurses6-config.1.html
doc/html/man/captoinfo.1m.html
doc/html/man/clear.1.html
doc/html/man/curs_window.3x.html
doc/html/man/form.3x.html
doc/html/man/infocmp.1m.html
doc/html/man/infotocap.1m.html
doc/html/man/menu.3x.html
doc/html/man/ncurses.3x.html
doc/html/man/ncurses6-config.1.html
doc/html/man/panel.3x.html
doc/html/man/tabs.1.html
doc/html/man/terminfo.5.html
doc/html/man/tic.1m.html
doc/html/man/toe.1m.html
doc/html/man/tput.1.html
doc/html/man/tset.1.html
man/curs_window.3x
ncurses/base/lib_getch.c
ncurses/base/lib_mouse.c
ncurses/base/lib_set_term.c
ncurses/curses.priv.h
ncurses/tinfo/entries.c
ncurses/tinfo/lib_setup.c
ncurses/tinfo/tinfo_driver.c
ncurses/tty/lib_tstp.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
test/README
test/demo_tabs.c
test/modules
test/programs
test/test_delwin.c [new file with mode: 0644]
test/worm.c

index 8c3a1dc1d5fe9cd8cee1c2cc0bc2176ab4c5ecf2..ce65f85dd06a68e0667e9b7d8c393a3c17388b68 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/test_addstr.c
 ./test/test_addwstr.c
 ./test/test_arrays.c
+./test/test_delwin.c
 ./test/test_get_wstr.c
 ./test/test_getstr.c
 ./test/test_instr.c
diff --git a/NEWS b/NEWS
index 9b1a9040415ceb783522cdffeebfb56875209752..8dca9518ae543699485205f6a7b47c18b9068459 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3841 2022/08/06 19:13:14 tom Exp $
+-- $Id: NEWS,v 1.3846 2022/08/13 23:42:30 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,16 @@ 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.
 
+20220813
+       + modify delscreen to more effectively delete all windows on the given
+         screen.
+       + amend portability note for delwin in manual page.
+       + adapt test/test_delwin.c from example by Bill Gray.
+       + account for prescreen data if freeing leaks in pthread-configuration
+       + split-out _nc_set_read_thread(), to reduce compiler warnings about
+         pthread_self(), which may/may not be a weak symbol.
+       + improve pthread-configuration for test/worm.c
+
 20220806
        + amend end_of_stream() to allow for input files without a final
          newline.
diff --git a/VERSION b/VERSION
index f473b9bf6a185122727a776cec56e5f62de0125a..978194d74cb680b93370a1717bd7d3771c208c0e 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.3     20220806
+5:0:10 6.3     20220813
diff --git a/dist.mk b/dist.mk
index f3390b9a90fbddaf0399047576514d3234c528b0..531ead2ebdc281ad2ed9c562fce2699fa22fbdca 100644 (file)
--- 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.1496 2022/08/06 10:14:36 tom Exp $
+# $Id: dist.mk,v 1.1497 2022/08/13 09:43:55 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 = 20220806
+NCURSES_PATCH = 20220813
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index e1e4b8e383fd690104f3abb0d8b7b252deacec39..28a543dc6383a4a62eedc0f6c2d3e858ee92ca04 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 522f97be195ccca9158f5537200b2cf846aa3b4f..8f78a276bd6735221eef73bf3dc9a16cd0408f93 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 94ba5d55864b3411b8d9d29ddca6c0e661a6f5ba..8e13a37ce7d3a0f42553ae96ac4eeb9b83b163ad 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG>xterm(1)</STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 1bd25353603a792615b0253279bd221ba6d208f0..660ed566fd72c60357778012cd8a8069effebfe5 100644 (file)
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_window.3x,v 1.27 2022/07/24 15:35:15 tom Exp @
+  * @Id: curs_window.3x,v 1.28 2022/08/13 23:24:22 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
            ent window which still has subwindows.
 
        <STRONG>o</STRONG>   Since release 4.0 (1996), ncurses maintains a list of  windows  for
-           each  screen,  and  is  able  to recursively delete subwindows when
-           asked to delete their parent.
+           each  screen,  to ensure that a window has no subwindows before al-
+           lowing deletion.
 
        <STRONG>o</STRONG>   NetBSD copied this feature of ncurses in 2003.
            PDCurses follows the scheme used in Solaris X/Open curses.
index ad408f0df8a75f5bbf9c30eb5a1814a2c7ec2420..c0eadee01ebe57d82c692145b7f8ae83f1fd81f9 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "form_"  for  detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 79dff9ee143f59680d84b7e36b0653b6df6952fc..e528651bbd8cf1ee700f80ba29da20f4d543dc6a 100644 (file)
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index c6c32f206a153bc4184eb905a1929931f10138c5..5e9ca04b9c124abeff1590873df0e8ff8322d2af 100644 (file)
@@ -91,7 +91,7 @@
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 755298580223cf1da13e0d70c8c37bfa7b83f8c5..ed9a098cf10b301ab3ebc94c9a31f109e1b86f85 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 93ff3ca232651f8585a8aaaf8b89bd45e36afa93..1fdc512afef1afdbcd0a0a4ed1b98aa498cce215 100644 (file)
@@ -60,7 +60,7 @@
        method of updating  character  screens  with  reasonable  optimization.
        This  implementation  is  "new  curses"  (ncurses)  and is the approved
        replacement for 4.4BSD classic curses,  which  has  been  discontinued.
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
        The  <STRONG>ncurses</STRONG>  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
index fc8193ec54f141cddb7dc310a48cda0ba0dcc77c..452c48db6c50be376b6591e7c88aa655637393cf 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 26dc1b18fa5cb9ea9dfcde623d59036277d02fb7..a3922fbaca7ec9d0312ffb0e952ec58b98bb62b1 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 84cb384b92b8a726ccd59d08bea7afe10189f7a9..89a3fad404ce4fa76c364ad75a53a52565c37a33 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index a3ea785bbdf5c828e254a0018e2d1ae63b4ef707..bc30bf9751b179a711f49b821a7791ddce99c95b 100644 (file)
        have, by specifying how to perform screen operations, and by specifying
        padding requirements and initialization sequences.
 
-       This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
index e4c99e14be13590b106f7ec527d0eb0e1cdca3c4..4a0d0676dc8afe26edea16593843ea65ea9f1b0a 100644 (file)
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.  <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index d097fc10387022ec6df14d321b1604643571dedc..2cbd734b8a9a281a8fa3c67c27389aa2dc4df888 100644 (file)
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 8d68b72b147fbff6a4bb93b4a4a891c3478db815..9e93cd3d761dae3d9712959bf00252cb4d49a6d1 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index 6359953e0e4565cfc0103fd36c508cd2fbf64f6e..243433b05508bb814adc42d6d4f602f9f633c49c 100644 (file)
        <STRONG>csh(1)</STRONG>,   <STRONG>sh(1)</STRONG>,   <STRONG>stty(1)</STRONG>,   <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>,  <STRONG>tty(4)</STRONG>,  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
        <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
 
 
 
index c786650ecf4dc062d9c675e0d76dc64955e0453d..f37eb5f65cbf33e1ba7bc9c70f415b23ce13dff1 100644 (file)
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_window.3x,v 1.27 2022/07/24 15:35:15 tom Exp $
+.\" $Id: curs_window.3x,v 1.28 2022/08/13 23:24:22 tom Exp $
 .TH curs_window 3X ""
 .de bP
 .ie n  .IP \(bu 4
@@ -269,7 +269,7 @@ Solaris X/Open curses does not even make that check,
 and will delete a parent window which still has subwindows.
 .bP
 Since release 4.0 (1996), ncurses maintains a list of windows for each screen,
-and is able to recursively delete subwindows when asked to delete their parent.
+to ensure that a window has no subwindows before allowing deletion.
 .bP
 NetBSD copied this feature of ncurses in 2003.
 .br
index 0d719cfcda97649d2f671ee5ca2d0ffa7558f771..43460394a490d21ff4c8332b0474e8f4222cceda 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2018-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2015,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -44,7 +44,7 @@
 #define NEED_KEY_EVENT
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_getch.c,v 1.143 2021/10/23 17:06:20 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.144 2022/08/13 14:36:43 tom Exp $")
 
 #include <fifo_defs.h>
 
@@ -309,16 +309,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
        int buf;
 # if defined(EXP_WIN32_DRIVER)
        if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) {
-#  if USE_PTHREADS_EINTR
-           if ((pthread_self) && (pthread_kill) && (pthread_equal))
-               _nc_globals.read_thread = pthread_self();
-#  endif
+           _nc_set_read_thread(TRUE);
            n = _nc_console_read(sp,
                                 _nc_console_handle(sp->_ifd),
                                 &buf);
-#  if USE_PTHREADS_EINTR
-           _nc_globals.read_thread = 0;
-#  endif
+           _nc_set_read_thread(FALSE);
        } else
 # elif defined(_NC_WINDOWS)
        if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak)
@@ -334,12 +329,8 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
        int buf;
 #endif
        unsigned char c2 = 0;
-#if USE_PTHREADS_EINTR
-#if USE_WEAK_SYMBOLS
-       if ((pthread_self) && (pthread_kill) && (pthread_equal))
-#endif
-           _nc_globals.read_thread = pthread_self();
-#endif
+
+       _nc_set_read_thread(TRUE);
 #if defined(EXP_WIN32_DRIVER)
        n = _nc_console_read(sp,
                             _nc_console_handle(sp->_ifd),
@@ -348,9 +339,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
 #else
        n = (int) read(sp->_ifd, &c2, (size_t) 1);
 #endif
-#if USE_PTHREADS_EINTR
-       _nc_globals.read_thread = 0;
-#endif
+       _nc_set_read_thread(FALSE);
        ch = c2;
 #endif /* USE_TERM_DRIVER */
     }
index c70cb5a3fc8484ca2ebb1b475fb6c3c5db8481dd..f4151b815bec87722f4f7dd33a0e9144aeeb02b7 100644 (file)
@@ -85,7 +85,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.196 2022/04/30 23:21:34 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.197 2022/08/13 14:13:12 tom Exp $")
 
 #include <tic.h>
 
@@ -1085,12 +1085,7 @@ decode_xterm_X10(SCREEN *sp, MEVENT * eventp)
     int res;
     bool result;
 
-# if USE_PTHREADS_EINTR
-#  if USE_WEAK_SYMBOLS
-    if ((pthread_self) && (pthread_kill) && (pthread_equal))
-#  endif
-       _nc_globals.read_thread = pthread_self();
-# endif
+    _nc_set_read_thread(TRUE);
     for (grabbed = 0; grabbed < MAX_KBUF; grabbed += (size_t) res) {
 
        /* For VIO mouse we add extra bit 64 to disambiguate button-up. */
@@ -1104,9 +1099,7 @@ decode_xterm_X10(SCREEN *sp, MEVENT * eventp)
        if (res == -1)
            break;
     }
-#if USE_PTHREADS_EINTR
-    _nc_globals.read_thread = 0;
-#endif
+    _nc_set_read_thread(FALSE);
     kbuf[MAX_KBUF] = '\0';
 
     TR(TRACE_IEVENT,
@@ -1140,12 +1133,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp)
     coords[0] = 0;
     coords[1] = 0;
 
-# if USE_PTHREADS_EINTR
-#  if USE_WEAK_SYMBOLS
-    if ((pthread_self) && (pthread_kill) && (pthread_equal))
-#  endif
-       _nc_globals.read_thread = pthread_self();
-# endif
+    _nc_set_read_thread(TRUE);
     for (grabbed = 0; grabbed < limit;) {
        int res;
 
@@ -1178,9 +1166,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp)
                break;
        }
     }
-#if USE_PTHREADS_EINTR
-    _nc_globals.read_thread = 0;
-#endif
+    _nc_set_read_thread(FALSE);
 
     TR(TRACE_IEVENT,
        ("_nc_mouse_inline sees the following xterm data: %s",
@@ -1224,12 +1210,7 @@ read_SGR(SCREEN *sp, SGR_DATA * result)
     int marker = 1;
 
     memset(result, 0, sizeof(*result));
-# if USE_PTHREADS_EINTR
-#  if USE_WEAK_SYMBOLS
-    if ((pthread_self) && (pthread_kill) && (pthread_equal))
-#  endif
-       _nc_globals.read_thread = pthread_self();
-# endif
+    _nc_set_read_thread(TRUE);
 
     do {
        int res;
@@ -1294,9 +1275,7 @@ read_SGR(SCREEN *sp, SGR_DATA * result)
        }
        ++grabbed;
     } while (!isFinal(ch));
-#if USE_PTHREADS_EINTR
-    _nc_globals.read_thread = 0;
-#endif
+    _nc_set_read_thread(FALSE);
 
     kbuf[++grabbed] = 0;
     TR(TRACE_IEVENT,
index 9d61f5aea58d9605e6e4ad69bf2fa585a7ebf146..3b41d784254f2d08903d4c5404387ef3650ae397 100644 (file)
@@ -54,7 +54,7 @@
 #undef CUR
 #define CUR SP_TERMTYPE
 
-MODULE_ID("$Id: lib_set_term.c,v 1.181 2022/07/21 23:35:21 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.182 2022/08/13 23:14:26 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -146,6 +146,7 @@ delscreen(SCREEN *sp)
 
     _nc_lock_global(curses);
     if (delink_screen(sp)) {
+       WINDOWLIST *wl;
        bool is_current = (sp == CURRENT_SCREEN);
 
 #ifdef USE_SP_RIPOFF
@@ -162,9 +163,13 @@ delscreen(SCREEN *sp)
        }
 #endif
 
-       (void) _nc_freewin(CurScreen(sp));
-       (void) _nc_freewin(NewScreen(sp));
-       (void) _nc_freewin(StdScreen(sp));
+       /* delete all of the windows in this screen */
+      rescan:
+       for (each_window(sp, wl)) {
+           if (_nc_freewin(&(wl->win)) == OK) {
+               goto rescan;
+           }
+       }
 
        if (sp->_slk != 0) {
 
index 60199f909b15f87f12b57978547e54e56b078a36..1e8ec70badc7c6005fe449009736a0e0e0b2455b 100644 (file)
@@ -35,7 +35,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.650 2022/05/01 14:41:33 tom Exp $
+ * $Id: curses.priv.h,v 1.651 2022/08/13 14:35:01 tom Exp $
  *
  *     curses.priv.h
  *
@@ -672,9 +672,14 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
 #define _nc_lock_global(name)  /* nothing */
 #define _nc_try_global(name)    0
 #define _nc_unlock_global(name)        /* nothing */
-
 #endif /* USE_PTHREADS */
 
+#if USE_PTHREADS_EINTR || defined(EXP_WIN32_DRIVER)
+extern NCURSES_EXPORT(void) _nc_set_read_thread(bool);
+#else
+#define _nc_set_read_thread(enable)    /* nothing */
+#endif
+
 /*
  * When using sp-funcs, locks are targeted to SCREEN-level granularity.
  * So the locking is done in the non-sp-func (which calls the sp-func) rather
index 5f49ece90b7b5f130c4427df80dbfe334726d96c..8c5e10c00e705a631136a95315a238306279506c 100644 (file)
@@ -38,7 +38,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: entries.c,v 1.33 2022/05/07 17:08:11 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.34 2022/08/13 16:57:35 tom Exp $")
 
 /****************************************************************************
  *
@@ -125,6 +125,22 @@ _nc_leaks_tinfo(void)
     _nc_free_tparm(cur_term);
     _nc_tgetent_leaks();
 
+#ifdef USE_PTHREADS
+    /*
+     * Discard any prescreen data which is not used for the current screen.
+     */
+    _nc_lock_global(screen);
+    {
+       PRESCREEN_LIST *p;
+       pthread_t id = GetThreadID();
+       for (p = _nc_prescreen.allocated; p != 0; p = p->next) {
+           if (p->id == id && p->sp != CURRENT_SCREEN) {
+               FreeAndNull(p->sp);
+           }
+       }
+    }
+    _nc_unlock_global(screen);
+#endif
     if (TerminalOf(CURRENT_SCREEN) != 0) {
        del_curterm(TerminalOf(CURRENT_SCREEN));
     }
index 89c40f9681e11ebd72511caa918e4a898412840f..db93a368fda162022a48dda6edda2468e41140f7 100644 (file)
@@ -49,7 +49,7 @@
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.217 2022/07/21 08:24:50 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.218 2022/08/13 18:12:22 tom Exp $")
 
 /****************************************************************************
  *
@@ -831,7 +831,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
        if (NC_ISATTY(Filedes)) {
            NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
            NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
-           NCURSES_SP_NAME(baudrate)(NCURSES_SP_ARG);
+           NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
        }
        code = OK;
 #endif
@@ -908,6 +908,7 @@ _nc_forget_prescr(void)
 {
     PRESCREEN_LIST *p, *q;
     pthread_t id = GetThreadID();
+    _nc_lock_global(screen);
     for (p = _nc_prescreen.allocated, q = 0; p != 0; q = p, p = p->next) {
        if (p->id == id) {
            if (q) {
@@ -919,6 +920,7 @@ _nc_forget_prescr(void)
            break;
        }
     }
+    _nc_unlock_global(screen);
 }
 #endif /* USE_PTHREADS */
 
index fb6496f0c986250d63e0755ba18ba907764117bc..eb4ecb3dd3034882d9a69296305996c65fbb4e5e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2018-2021,2022 Thomas E. Dickey                                *
  * Copyright 2008-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -52,7 +52,7 @@
 # endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.72 2021/06/17 21:30:22 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.73 2022/08/13 14:36:43 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -1282,10 +1282,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
     assert(buf);
     SetSP();
 
-# if USE_PTHREADS_EINTR
-    if ((pthread_self) && (pthread_kill) && (pthread_equal))
-       _nc_globals.read_thread = pthread_self();
-# endif
+    _nc_set_read_thread(TRUE);
 #ifdef EXP_WIN32_DRIVER
     n = _nc_console_read(sp,
                         _nc_console_handle(sp->_ifd),
@@ -1293,9 +1290,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
 #else
     n = (int) read(sp->_ifd, &c2, (size_t) 1);
 #endif
-#if USE_PTHREADS_EINTR
-    _nc_globals.read_thread = 0;
-#endif
+    _nc_set_read_thread(FALSE);
 #ifndef EXP_WIN32_DRIVER
     *buf = (int) c2;
 #endif
index a20e72a9d96b159e82356af7845bb23744b5aa35..ec086ca730c8dce69ec4b845d6f62ef0d0cf2cb4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 2020-2021,2022 Thomas E. Dickey                                *
  * Copyright 1998-2014,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -43,7 +43,7 @@
 
 #include <SigAction.h>
 
-MODULE_ID("$Id: lib_tstp.c,v 1.51 2021/09/04 10:54:35 tom Exp $")
+MODULE_ID("$Id: lib_tstp.c,v 1.52 2022/08/13 14:36:43 tom Exp $")
 
 #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
 #define USE_SIGTSTP 1
@@ -284,6 +284,22 @@ handle_SIGINT(int sig)
 }
 
 #if USE_SIGWINCH
+
+# ifndef _nc_set_read_thread
+NCURSES_EXPORT(void)
+_nc_set_read_thread(bool enable)
+{
+    if (enable) {
+#  if USE_WEAK_SYMBOLS
+       if ((pthread_self) && (pthread_kill) && (pthread_equal))
+#  endif
+           _nc_globals.read_thread = pthread_self();
+    } else {
+       _nc_globals.read_thread = 0;
+    }
+}
+# endif
+
 static void
 handle_SIGWINCH(int sig GCC_UNUSED)
 {
index 1e32b6caaa2b9ca6aebd09905dd7fd5635d5daed..aabe841724fee1b715511a53bbb23cc9c9d8872c 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220806) unstable; urgency=low
+ncurses6 (6.3+20220813) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 06 Aug 2022 06:14:36 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 13 Aug 2022 05:43:55 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 1e32b6caaa2b9ca6aebd09905dd7fd5635d5daed..aabe841724fee1b715511a53bbb23cc9c9d8872c 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220806) unstable; urgency=low
+ncurses6 (6.3+20220813) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 06 Aug 2022 06:14:36 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 13 Aug 2022 05:43:55 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index c0d2c646a056beef3c4a7b0987b71c98aa95e512..870eea54cec236a87240ba8b27006a795dcc8d13 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220806) unstable; urgency=low
+ncurses6 (6.3+20220813) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 06 Aug 2022 06:14:36 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 13 Aug 2022 05:43:55 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index f3bfa13994026c2bf2d636985c25b9cf3ec19f9f..f88830012bdc6d1098bb8d3845845b7eab7942fd 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.536 2022/08/06 10:14:36 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.537 2022/08/13 09:43:55 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "3"\r
 !define VERSION_YYYY  "2022"\r
-!define VERSION_MMDD  "0806"\r
+!define VERSION_MMDD  "0813"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index ae2e3ca9f4c3b4ee5dcc0a97422f2d0ead835e40..36d9dc56b9a378bbeefcaa876b1d8c4dbf173d4e 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
-Release: 20220806
+Release: 20220813
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 812e7abec0d11c888e1cc59b6dc3376ef148a9df..3f0bb4b1ff6ab50f19786d5145bcc04189e2a2af 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
-Release: 20220806
+Release: 20220813
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index c2f80db5630b54a2c27ca4e301ba7cb55fe899e8..efc0c72eed37d61538e72b4431be4967280eb33f 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
-Release: 20220806
+Release: 20220813
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 4eb8f2d8161de3e2e18fb9349f88b7372215fb73..7844aa7e39049cf3e9a7a5758162578fa9cf35f9 100644 (file)
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README,v 1.76 2022/06/04 23:25:37 tom Exp $
+-- $Id: README,v 1.77 2022/08/13 23:34:33 tom Exp $
 -------------------------------------------------------------------------------
 
 The programs in this directory are used to test and demonstrate ncurses.
@@ -234,9 +234,9 @@ BC                          test: demo_termcap
 COLORS                         test: color_content demo_new_pair dots_curses dots_xcurses echochar ncurses pair_content picsmap savescreen xmas
 COLOR_PAIR                     test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels dots_curses dup_field echochar filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 COLOR_PAIRS                    test: demo_new_pair dots_curses dots_xcurses echochar ncurses newdemo pair_content
-COLS                           test: cardfile combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
+COLS                           test: cardfile combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
 ESCDELAY                       test: test_opaque
-LINES                          test: cardfile combine demo_defkey demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest move_field movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+LINES                          test: cardfile combine demo_defkey demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest move_field movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 PAIR_NUMBER                    test: dump_window ncurses
 PC                             test: demo_termcap
 SP                             lib: form
@@ -277,11 +277,11 @@ boolfnames                        test: demo_terminfo test_arrays progs: dump_entry
 boolnames                      test: demo_terminfo test_arrays progs: dump_entry infocmp
 border                         -
 border_set                     -
-box                            test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+box                            test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
 box_set                                test: ncurses
 can_change_color               test: color_content extended_color ncurses
 can_change_color_sp            test: extended_color
-cbreak                         test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
+cbreak                         test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
 cbreak_sp                      test: sp_tinfo
 chgat                          test: chgat
 clear                          test: blue bs filter gdc ncurses padview testcurs xmas
@@ -310,9 +310,9 @@ delay_output                        test: newdemo
 delay_output_sp                        test: sp_tinfo
 delch                          -
 deleteln                       test: insdelln
-delscreen                      test: ditto dots_mvcur
-delwin                         test: cardfile chgat clip_printw demo_forms demo_panels dup_field inch_wide inchs ins_wide insdelln inserts move_field ncurses newdemo padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view
-derwin                         test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
+delscreen                      test: ditto dots_mvcur test_delwin
+delwin                         test: cardfile chgat clip_printw demo_forms demo_panels dup_field inch_wide inchs ins_wide insdelln inserts move_field ncurses newdemo padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view
+derwin                         test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque
 doupdate                       test: cardfile demo_menus demo_panels ditto ins_wide inserts knight movewindow ncurses padview popup_msg redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
 doupdate_sp                    lib: ncurses
 dupwin                         test: popup_msg
@@ -320,14 +320,14 @@ echo                              test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
 echo_sp                                lib: ncurses
 echo_wchar                     test: ncurses
 echochar                       test: echochar ncurses
-endwin                         test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_mvcur dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testaddch testcurs testscanw view worm xmas
+endwin                         test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_mvcur dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testaddch testcurs testscanw view worm xmas
 endwin_sp                      lib: ncurses
 erase                          test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses picsmap tclock test_opaque testcurs
 erasechar                      test: ncurses
 erasechar_sp                   test: sp_tinfo
 erasewchar                     test: ncurses
 erasewchar_sp                  lib: ncurses
-exit_curses                    test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_setupterm test_termattrs test_unget_wch testaddch testcurs testscanw view worm xmas
+exit_curses                    test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_setupterm test_termattrs test_unget_wch testaddch testcurs testscanw view worm xmas
 exit_terminfo                  test: demo_termcap demo_terminfo dots dots_mvcur dots_termcap list_keys railroad sp_tinfo test_arrays test_sgr test_tparm test_vid_puts test_vidputs
 extended_color_content         test: color_content extended_color
 extended_color_content_sp      test: extended_color
@@ -539,7 +539,7 @@ mvwinsnstr                  test: inserts
 mvwinsstr                      test: inserts testcurs
 mvwinstr                       test: test_instr
 mvwinwstr                      test: test_inwstr
-mvwprintw                      test: demo_menus demo_panels inch_wide inchs ncurses test_instr test_inwstr testcurs
+mvwprintw                      test: demo_menus demo_panels inch_wide inchs ncurses test_delwin test_instr test_inwstr testcurs
 mvwscanw                       test: testcurs
 mvwvline                       test: ins_wide inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr
 mvwvline_set                   -
@@ -549,16 +549,16 @@ new_prescr                        test: sp_tinfo
 newpad                         test: ncurses padview popup_msg testcurs
 newpad_sp                      lib: ncurses
 newscr                         lib: ncurses
-newterm                                test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_setupterm test_termattrs
+newterm                                test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_delwin test_setupterm test_termattrs
 newterm_sp                     -
-newwin                         test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
+newwin                         test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
 newwin_sp                      lib: ncurses
 nl                             test: demo_forms dup_field move_field ncurses rain testcurs
 nl_sp                          lib: ncurses
 nocbreak                       test: testcurs
 nocbreak_sp                    test: sp_tinfo
 nodelay                                test: demo_new_pair ditto extended_color firework gdc lrtest ncurses newdemo padview rain tclock test_opaque view worm xmas
-noecho                         test: back_ground background bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
+noecho                         test: back_ground background bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
 noecho_sp                      lib: ncurses
 nofilter                       -
 nofilter_sp                    -
@@ -581,7 +581,7 @@ pecho_wchar                 -
 pechochar                      -
 pnoutrefresh                   test: ncurses padview popup_msg
 prefresh                       test: testcurs
-printw                         test: back_ground background blue bs color_content color_set combine demo_altkeys demo_defkey demo_keyok demo_tabs extended_color filter foldkeys ncurses pair_content savescreen test_unget_wch testcurs testscanw view
+printw                         test: back_ground background blue bs color_content color_set combine demo_altkeys demo_defkey demo_keyok demo_tabs extended_color filter foldkeys ncurses pair_content savescreen test_delwin test_unget_wch testcurs testscanw view
 putp                           test: filter test_mouse test_sgr progs: tput
 putp_sp                                test: sp_tinfo
 putwin                         test: ncurses
@@ -590,7 +590,7 @@ qiflush_sp                  test: sp_tinfo
 raw                            test: demo_forms dup_field move_field ncurses redraw testcurs
 raw_sp                         test: sp_tinfo
 redrawwin                      test: combine padview redraw view
-refresh                                test: blue bs color_content demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs dots_curses dots_mvcur dots_xcurses dup_field echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest move_field movewindow ncurses pair_content picsmap savescreen tclock test_mouse testcurs view xmas
+refresh                                test: blue bs color_content demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs dots_curses dots_mvcur dots_xcurses dup_field echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest move_field movewindow ncurses pair_content picsmap savescreen tclock test_delwin test_mouse testcurs view xmas
 reset_color_pairs              test: picsmap
 reset_color_pairs_sp           -
 reset_prog_mode                        test: filter ncurses
@@ -619,7 +619,7 @@ scr_set                             test: savescreen
 scr_set_sp                     -
 scrl                           test: view
 scroll                         test: testcurs
-scrollok                       test: clip_printw color_content demo_altkeys demo_defkey demo_keyok demo_new_pair demo_panels ditto foldkeys hashtest knight ncurses pair_content picsmap redraw test_opaque test_unget_wch testcurs testscanw view
+scrollok                       test: clip_printw color_content demo_altkeys demo_defkey demo_keyok demo_new_pair demo_panels ditto foldkeys hashtest knight ncurses pair_content picsmap redraw test_delwin test_opaque test_unget_wch testcurs testscanw view
 set_curterm                    test: list_keys sp_tinfo
 set_curterm_sp                 test: sp_tinfo
 set_escdelay                   test: test_opaque
@@ -665,7 +665,7 @@ standend                    test: blue gdc ncurses
 standout                       test: blue ncurses
 start_color                    test: back_ground background blue bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 start_color_sp                 -
-stdscr                         test: back_ground background bs chgat clip_printw color_content combine demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto dup_field edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs testscanw view worm xmas
+stdscr                         test: back_ground background bs chgat clip_printw color_content combine demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto dup_field edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs testscanw view worm xmas
 strcodes                       test: demo_termcap test_arrays progs: dump_entry
 strfnames                      test: demo_terminfo list_keys test_arrays progs: dump_entry
 strnames                       test: demo_terminfo foldkeys list_keys test_arrays test_tparm progs: dump_entry infocmp tic
@@ -696,7 +696,7 @@ tigetstr_sp                 test: sp_tinfo
 timeout                                test: filter rain savescreen
 tiparm                         -
 touchline                      test: chgat clip_printw insdelln
-touchwin                       test: chgat clip_printw demo_menus filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
+touchwin                       test: chgat clip_printw demo_menus filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
 tparm                          test: dots dots_mvcur test_mouse test_sgr test_tparm progs: tic tput
 tputs                          test: dots dots_mvcur dots_termcap railroad test_tparm test_vid_puts test_vidputs progs: clear_cmd reset_cmd tabs
 tputs_sp                       test: sp_tinfo
@@ -763,7 +763,7 @@ wborder                             test: ncurses
 wborder_set                    test: ncurses
 wchgat                         test: chgat test_get_wstr test_getstr view
 wclear                         test: ncurses test_opaque testcurs
-wclrtobot                      test: firstlast inch_wide inchs ncurses test_instr test_inwstr testcurs
+wclrtobot                      test: firstlast inch_wide inchs ncurses test_delwin test_instr test_inwstr testcurs
 wclrtoeol                      test: chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels firstlast inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_instr test_inwstr testcurs
 wcolor_set                     lib: ncurses
 wcursyncup                     lib: form
@@ -776,7 +776,7 @@ werase                              test: cardfile demo_forms demo_menus demo_panels dup_field firstlast k
 wget_wch                       test: ins_wide ncurses test_add_wchstr test_addwstr
 wget_wstr                      test: test_get_wstr
 wgetbkgrnd                     lib: ncurses
-wgetch                         test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto dump_window dup_field edit_field gdc insdelln inserts knight move_field movewindow ncurses newdemo popup_msg rain redraw test_addchstr test_addstr test_opaque testcurs worm
+wgetch                         test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto dump_window dup_field edit_field gdc insdelln inserts knight move_field movewindow ncurses newdemo popup_msg rain redraw test_addchstr test_addstr test_delwin test_opaque testcurs worm
 wgetdelay                      test: test_opaque
 wgetn_wstr                     test: ncurses test_get_wstr
 wgetnstr                       test: ncurses test_getstr
@@ -808,11 +808,11 @@ wmove                             test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus
 wnoutrefresh                   test: demo_menus ditto inch_wide inchs ins_wide inserts knight movewindow ncurses padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
 wprintw                                test: chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque testcurs
 wredrawln                      test: redraw
-wrefresh                       test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels dup_field firstlast ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs worm xmas
+wrefresh                       test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels dup_field firstlast ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin testcurs worm xmas
 wresize                                test: cardfile demo_menus ncurses
 wscanw                         test: testcurs
 wscrl                          test: ncurses testcurs
-wsetscrreg                     test: ncurses testcurs
+wsetscrreg                     test: ncurses test_delwin testcurs
 wstandend                      test: ncurses test_opaque xmas
 wstandout                      test: ncurses test_opaque xmas
 wsyncdown                      test: movewindow
index 6bd067eac86b0e4755655007698e4e109e564ed6..2fa79287694b4e0a0bfeaccae4e3f872a1aca045 100644 (file)
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_tabs.c,v 1.6 2022/05/15 13:04:57 tom Exp $
+ * $Id: demo_tabs.c,v 1.7 2022/08/13 21:02:25 tom Exp $
  *
  * A simple demo of tabs in curses.
  */
 #define USE_CURSES
 #define USE_TINFO
-#include "test.priv.h"
+#include <test.priv.h>
 
 static void
 usage(void)
index 6c5125f7518a10ab633d98c8583c418d69942a3c..7e3fcc221cf5b2dff10230f314146aa573453d7c 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.77 2022/05/07 22:39:21 tom Exp $
+# $Id: modules,v 1.78 2022/08/13 20:53:43 tom Exp $
 ##############################################################################
 # Copyright 2018-2021,2022 Thomas E. Dickey                                  #
 # Copyright 1998-2016,2017 Free Software Foundation, Inc.                    #
@@ -101,6 +101,7 @@ test_addchstr       progs           $(srcdir)       $(HEADER_DEPS)  $(srcdir)/linedata.h
 test_addstr    progs           $(srcdir)       $(HEADER_DEPS)  $(srcdir)/linedata.h
 test_addwstr   progs           $(srcdir)       $(HEADER_DEPS)  $(srcdir)/linedata.h
 test_arrays    progs           $(srcdir)       $(HEADER_DEPS)
+test_delwin    progs           $(srcdir)       $(HEADER_DEPS)
 test_get_wstr  progs           $(srcdir)       $(HEADER_DEPS)
 test_getstr    progs           $(srcdir)       $(HEADER_DEPS)
 test_instr     progs           $(srcdir)       $(HEADER_DEPS)
index 306a1b075f0d446eea6e7606019ec750bc1d98d9..191a16dca1e57dba16da1ee82a9c81737ddd7cd7 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: programs,v 1.53 2022/05/07 22:39:49 tom Exp $
+# $Id: programs,v 1.55 2022/08/13 23:37:10 tom Exp $
 ##############################################################################
 # Copyright 2018-2021,2022 Thomas E. Dickey                                  #
 # Copyright 2006-2016,2017 Free Software Foundation, Inc.                    #
@@ -96,6 +96,7 @@ test_addchstr $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_addchstr
 test_addstr    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_addstr
 test_addwstr   $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_addwstr
 test_arrays    $(LDFLAGS_TINFO)        $(LOCAL_LIBS)   test_arrays
+test_delwin    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_delwin
 test_get_wstr  $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_get_wstr popup_msg
 test_getstr    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_getstr popup_msg
 test_instr     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_instr
diff --git a/test/test_delwin.c b/test/test_delwin.c
new file mode 100644 (file)
index 0000000..450dad1
--- /dev/null
@@ -0,0 +1,117 @@
+/****************************************************************************
+ * Copyright 2022 Thomas E. Dickey                                          *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/*
+ * $Id: test_delwin.c,v 1.3 2022/08/14 00:12:52 tom Exp $
+ */
+#include <test.priv.h>
+
+#define STATUS 10
+
+static SCREEN *my_screen;
+
+static void
+show_rc(const char *what, const char *explain, int rc)
+{
+    printw("%s : %d (%s)\n", what, rc, explain);
+}
+
+static void
+next_step(WINDOW *win)
+{
+    int ch = wgetch(win);
+    if (ch == QUIT || ch == ESCAPE) {
+       endwin();
+       /* use this to verify if delscreen frees all memory */
+       delscreen(my_screen);
+       exit(EXIT_FAILURE);
+    }
+}
+
+int
+main(void)
+{
+    WINDOW *parent, *child1;
+    int rc;
+
+    if ((my_screen = newterm(NULL, stdout, stdin)) == NULL)
+       ExitProgram(EXIT_FAILURE);
+
+    noecho();
+    cbreak();
+
+    refresh();
+    wsetscrreg(stdscr, 0, STATUS - 1);
+    scrollok(stdscr, TRUE);
+
+    parent = newwin(0, 0, STATUS, 0);
+    box(parent, 0, 0);
+    wrefresh(parent);
+    next_step(parent);
+
+    printw("New window %p    %s\n", (void *) parent, "Top window");
+    mvwprintw(parent, 1, 1, "Top window");
+    wrefresh(parent);
+    next_step(stdscr);
+
+    child1 = derwin(parent, LINES - STATUS - 4, COLS - 4, 2, 2);
+    box(child1, 0, 0);
+    mvwprintw(child1, 1, 1, "Sub window");
+    wrefresh(child1);
+
+    printw("Sub window %p    %s\n", (void *) child1, "Hello world!");
+    next_step(stdscr);
+
+    show_rc("Deleted parent",
+           "should fail, it still has a subwindow",
+           rc = delwin(parent));
+    next_step(stdscr);
+    show_rc("Deleted child1",
+           "should succeed",
+           rc = delwin(child1));
+    next_step(stdscr);
+    if (rc == OK) {
+       wclrtobot(parent);
+       box(parent, 0, 0);
+       next_step(parent);
+    }
+    show_rc("Deleted parent",
+           "should succeed, it has no subwindow now",
+           rc = delwin(parent));
+    next_step(stdscr);
+    if (rc == OK) {
+       touchwin(stdscr);
+       next_step(stdscr);
+    }
+    show_rc("Deleted parent",
+           "should fail, may dump core",
+           delwin(parent));
+    next_step(stdscr);
+    endwin();
+    ExitProgram(EXIT_SUCCESS);
+}
index 4888a519c8a256ac2b3a5040a5857d9e5b59d0bc..2ce1c5ee3ca258ffe2347a5523ef9ce759d08325 100644 (file)
@@ -53,7 +53,7 @@
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
-  $Id: worm.c,v 1.84 2022/07/23 17:06:16 tom Exp $
+  $Id: worm.c,v 1.85 2022/08/13 13:28:01 tom Exp $
 */
 
 #include <test.priv.h>
@@ -663,6 +663,15 @@ main(int argc, char *argv[])
 
     Trace(("Cleanup"));
     cleanup();
+#ifdef USE_PTHREADS
+    /*
+     * Do this just in case one of the threads did not really exit.
+     */
+    Trace(("join all threads"));
+    for (n = 0; n < number; n++) {
+       pthread_join(worm[n].thread, NULL);
+    }
+#endif
 #if NO_LEAKS
     for (y = 0; y < max_refs; y++) {
        free(refs[y]);
@@ -672,15 +681,6 @@ main(int argc, char *argv[])
        free(w->xpos);
        free(w->ypos);
     }
-#endif
-#ifdef USE_PTHREADS
-    /*
-     * Do this just in case one of the threads did not really exit.
-     */
-    Trace(("join all threads"));
-    for (n = 0; n < number; n++) {
-       pthread_join(worm[n].thread, NULL);
-    }
 #endif
     ExitProgram(EXIT_SUCCESS);
 }