]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.3 - patch 20220917
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 17 Sep 2022 23:40:53 +0000 (23:40 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 17 Sep 2022 23:40:53 +0000 (23:40 +0000)
+ reduce memory-leak in tic by separating allocations for struct entry
  from TERMTYPE2 (cf: 20220430).
+ improve interaction between tic -v option and NCURSES_TRACE, by
  processing the latter only when -v option does not set _nc_tracing.
+ modify curses_trace() to show the trace-mask as symbols, e.g.,
  TRACE_ORDINARY, DEBUG_LEVEL(3).

34 files changed:
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/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
include/tic.h
man/tic.1m
ncurses/tinfo/alloc_entry.c
ncurses/tinfo/alloc_ttype.c
ncurses/tinfo/comp_parse.c
ncurses/trace/lib_trace.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
progs/progs.priv.h
progs/tic.c

diff --git a/NEWS b/NEWS
index 5fdefda4fad8af3fca2d535057e054cb6d064bb3..241c6188ddaf74dbdaa987688797df3cc8c22ed0 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.3856 2022/09/10 22:31:34 tom Exp $
+-- $Id: NEWS,v 1.3858 2022/09/17 20:49:10 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.
 
+20220917
+       + reduce memory-leak in tic by separating allocations for struct entry
+         from TERMTYPE2 (cf: 20220430).
+       + improve interaction between tic -v option and NCURSES_TRACE, by
+         processing the latter only when -v option does not set _nc_tracing.
+       + modify curses_trace() to show the trace-mask as symbols, e.g.,
+         TRACE_ORDINARY, DEBUG_LEVEL(3).
+
 20220910
        + amend verbose-option change to make this affect level 3, e.g., using
          "tic -cv3 terminfo".
diff --git a/VERSION b/VERSION
index 0dbd28c3885a06b5f7e00c12243ae0be1080afd5..cecc275234302e137d17e7b162c63969f976a501 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.3     20220910
+5:0:10 6.3     20220917
diff --git a/dist.mk b/dist.mk
index a3ebf740f73dbe861ffb434890c5de0779c6d85f..3f682b53d9e0f394e5b50caf04a065b858d31bce 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.1501 2022/09/10 09:26:46 tom Exp $
+# $Id: dist.mk,v 1.1502 2022/09/17 10:53: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 = 3
-NCURSES_PATCH = 20220910
+NCURSES_PATCH = 20220917
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 28a543dc6383a4a62eedc0f6c2d3e858ee92ca04..02eb5eb5919dd62a164ffa0ba2d66bfc3e2bda54 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index 8f78a276bd6735221eef73bf3dc9a16cd0408f93..baec5d3003d2ffe051c07f7d188cb072518fd89b 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 8e13a37ce7d3a0f42553ae96ac4eeb9b83b163ad..f9ebf2d7cd6442395b919483b87c784962b5bf73 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index c0eadee01ebe57d82c692145b7f8ae83f1fd81f9..21021e2ad8be7344b3064ec68a8a823d9f09c6f2 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index e528651bbd8cf1ee700f80ba29da20f4d543dc6a..c5d240a10abaad0862279a1e0c193f825356a21b 100644 (file)
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 5e9ca04b9c124abeff1590873df0e8ff8322d2af..0ceba54611ba235b42585486888956da4718c61d 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index ed9a098cf10b301ab3ebc94c9a31f109e1b86f85..b7e3423dcf76d026a75e2a35af3b0f7dedf5d32a 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index 1fdc512afef1afdbcd0a0a4ed1b98aa498cce215..e80aea694bc3f8d7cb18583d2c02480233003887 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
        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 452c48db6c50be376b6591e7c88aa655637393cf..d18c95afd1699d284655deae953e794f5ca7fd51 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index a3922fbaca7ec9d0312ffb0e952ec58b98bb62b1..82d2b38f43c6cde00e14efc4e1b374ebcbbc5745 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 89a3fad404ce4fa76c364ad75a53a52565c37a33..94abb2390f6f99461adb4fd599b89b9921a4b9ac 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index bc30bf9751b179a711f49b821a7791ddce99c95b..6e8546053a6f45a595a5798922c98b2c61bfc471 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 20220813).
+       This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
index 4a0d0676dc8afe26edea16593843ea65ea9f1b0a..1c312a4e47fddeb72e4abfd9b646720a74afd01c 100644 (file)
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tic.1m,v 1.82 2022/02/12 20:02:20 tom Exp @
+  * @Id: tic.1m,v 1.84 2022/09/17 19:01:24 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
        <STRONG>-v</STRONG><EM>n</EM>  specifies that (verbose) output be written to standard error trace
             information showing <STRONG>tic</STRONG>'s progress.
 
-            The optional parameter <EM>n</EM> is a number  from  1  to  10,  inclusive,
-            indicating the desired level of detail of information.  If ncurses
-            is built  without  tracing  support,  the  optional  parameter  is
-            ignored.   If  <EM>n</EM>  is  omitted,  the  default  level is 1.  If <EM>n</EM> is
-            specified and greater than 1, the level of detail is increased.
+            The optional parameter <EM>n</EM> is a  number  from  1  to  9,  inclusive,
+            indicating the desired level of detail of information.
+
+            <STRONG>o</STRONG>   If  ncurses  is  built  without  tracing support, the optional
+                parameter is ignored.
+
+            <STRONG>o</STRONG>   If <EM>n</EM> is omitted, the default level is 1.
+
+            <STRONG>o</STRONG>   If <EM>n</EM> is specified and greater than 1, the level of  detail  is
+                increased,   and   the   output   is   written  (with  tracing
+                information) to the "trace" file.
 
             The debug flag levels are as follows:
 
-            1      Names of files created and linked
+            1   Names of files created and linked
+
+            2   Information related to the "use" facility
 
-            2      Information related to the "use" facility
+            3   Statistics from the hashing algorithm
 
-            3      Statistics from the hashing algorithm
+            4   Details of extended capabilities
 
-            5      String-table memory allocations
+            5   (unused)
 
-            7      Entries into the string-table
+            6   (unused)
 
-            8      List of tokens encountered by scanner
+            7   Entries into the string-table
 
-            9      All values computed in construction of the hash table
+            8   List of tokens encountered by scanner
 
-            If the debug level <EM>n</EM> is not given, it is taken to be one.
+            9   All values computed in construction of the hash table
 
        <STRONG>-W</STRONG>   By itself, the <STRONG>-w</STRONG>  option  will  not  force  long  strings  to  be
             wrapped.  Use the <STRONG>-W</STRONG> option to do this.
        <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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 2cbd734b8a9a281a8fa3c67c27389aa2dc4df888..c931b91b8c98d095eb4a816b22e576f757f44725 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index 9e93cd3d761dae3d9712959bf00252cb4d49a6d1..45f4169a91a4aa535463fbeefc60320be14927ca 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index 243433b05508bb814adc42d6d4f602f9f633c49c..19d6be67e82c92a50bf54d04d860998260e64b22 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 20220813).
+       This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
 
 
 
index 89350592e6d8b6dd32026adc2d78daaf77c81935..302c06d8a8b274e9b3511b57010c64af1d66c7dd 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: tic.h,v 1.85 2022/09/03 19:11:20 tom Exp $
+ * $Id: tic.h,v 1.86 2022/09/17 16:01:45 tom Exp $
  *     tic.h - Global variables and structures for the terminfo compiler.
  */
 
@@ -135,7 +135,7 @@ extern "C" {
 #define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT)
 
 #define set_trace_level(n) \
-       _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL + 1) - 1, \
+       _nc_tracing &= TRACE_MAXIMUM, \
        _nc_tracing |= DEBUG_LEVEL(n)
 
 #ifdef TRACE
index af646a260107a99f7d6c4d0d3f065fe947ecd23f..17f576fd8024eb226c406347f4a9d3c5384f4be2 100644 (file)
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tic.1m,v 1.82 2022/02/12 20:02:20 tom Exp $
+.\" $Id: tic.1m,v 1.84 2022/09/17 19:01:24 tom Exp $
 .TH @TIC@ 1M ""
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
@@ -320,16 +320,22 @@ reports the version of ncurses which was used in this program, and exits.
 specifies that (verbose) output be written to standard error trace
 information showing \fB@TIC@\fP's progress.
 .IP
-The optional parameter \fIn\fP is a number from 1 to 10, inclusive,
+The optional parameter \fIn\fP is a number from 1 to 9, inclusive,
 indicating the desired level of detail of information.
+.RS
+.bP
 If ncurses is built without tracing support, the optional parameter is ignored.
+.bP
 If \fIn\fP is omitted, the default level is 1.
+.bP
 If \fIn\fP is specified and greater than 1, the level of
-detail is increased.
+detail is increased, and the output is written (with tracing information)
+to the \*(``trace\*('' file.
+.RE
 .RS
 .PP
 The debug flag levels are as follows:
-.TP
+.TP 4
 1
 Names of files created and linked
 .TP
@@ -339,8 +345,14 @@ Information related to the \*(``use\*('' facility
 3
 Statistics from the hashing algorithm
 .TP
+4
+Details of extended capabilities
+.TP
 5
-String-table memory allocations
+(unused)
+.TP
+6
+(unused)
 .TP
 7
 Entries into the string-table
@@ -350,8 +362,6 @@ List of tokens encountered by scanner
 .TP
 9
 All values computed in construction of the hash table
-.LP
-If the debug level \fIn\fP is not given, it is taken to be one.
 .RE
 .TP
 \fB\-W\fP
index 219c76e6f4150f1c7f628cad924398d6cffc5aa3..90febbbd11e8a9da3217d1a55a5d95edb465b9f2 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: alloc_entry.c,v 1.74 2022/08/20 18:03:14 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.76 2022/09/17 21:45:44 tom Exp $")
 
 #define ABSENT_OFFSET    -1
 #define CANCELLED_OFFSET -2
@@ -234,10 +234,11 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings)
 #endif
 
     for (i = 0; i < nuses; i++) {
-       if (useoffsets[i] == ABSENT_OFFSET)
+       if (useoffsets[i] == ABSENT_OFFSET) {
            ep->uses[i].name = 0;
-       else
-           ep->uses[i].name = (tp->str_table + useoffsets[i]);
+       } else {
+           ep->uses[i].name = strdup(tp->str_table + useoffsets[i]);
+       }
     }
     DEBUG(2, (T_RETURN("")));
 }
@@ -250,6 +251,8 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
     TERMTYPE2 *from = &(source->tterm);
 #if NCURSES_XNAMES
     TERMTYPE2 copy;
+    size_t str_size = 0;
+    char *str_table = NULL;
 #endif
     unsigned i;
 
@@ -260,6 +263,46 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
     _nc_copy_termtype2(&copy, from);
     from = &copy;
     _nc_align_termtype(to, from);
+    str_size += strlen(to->term_names) + 1;
+    for_each_string(i, from) {
+       if (VALID_STRING(from->Strings[i]))
+           str_size += strlen(from->Strings[i]) + 1;
+    }
+    for_each_string(i, to) {
+       if (VALID_STRING(to->Strings[i]))
+           str_size += strlen(to->Strings[i]) + 1;
+    }
+    /* allocate a string-table large enough for both source/target, and
+     * copy all of the strings into that table.  In the merge, we will
+     * select from the original source/target lists to construct a new
+     * target list.
+     */
+    if (str_size != 0) {
+       char *str_copied;
+       if ((str_table = malloc(str_size)) == NULL)
+           _nc_err_abort(MSG_NO_MEMORY);
+       str_copied = str_table;
+       strcpy(str_copied, to->term_names);
+       to->term_names = str_copied;
+       str_copied += strlen(str_copied) + 1;
+       for_each_string(i, from) {
+           if (VALID_STRING(from->Strings[i])) {
+               strcpy(str_copied, from->Strings[i]);
+               from->Strings[i] = str_copied;
+               str_copied += strlen(str_copied) + 1;
+           }
+       }
+       for_each_string(i, to) {
+           if (VALID_STRING(to->Strings[i])) {
+               strcpy(str_copied, to->Strings[i]);
+               to->Strings[i] = str_copied;
+               str_copied += strlen(str_copied) + 1;
+           }
+       }
+       free(to->str_table);
+       to->str_table = str_table;
+       free(from->str_table);
+    }
 #endif
     for_each_boolean(i, from) {
        if (to->Booleans[i] != (NCURSES_SBOOL) CANCELLED_BOOLEAN) {
index 42ef05f47752b6146ca98d6425afbeb1d3f65cfb..6220c21051f5e4781a90c83e0d02698748c5fc37 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: alloc_ttype.c,v 1.44 2022/06/18 20:40:54 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.46 2022/09/17 21:44:35 tom Exp $")
 
 #if NCURSES_XNAMES
 /*
@@ -559,7 +559,7 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
            }
            str_size += strlen(src->term_names) + 1;
        }
-       for (i = 0; i < STRCOUNT; ++i) {
+       for_each_string(i, src) {
            if (VALID_STRING(src->Strings[i])) {
                if (pass) {
                    strcpy(new_table + str_size, src->Strings[i]);
@@ -572,7 +572,8 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
            dst->str_table = new_table;
        } else {
            ++str_size;
-           new_table = malloc(str_size);
+           if ((new_table = malloc(str_size)) == NULL)
+               _nc_err_abort(MSG_NO_MEMORY);
        }
     }
 
@@ -653,7 +654,8 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
                dst->ext_str_table = new_table;
            } else {
                ++str_size;
-               new_table = calloc(str_size, 1);
+               if ((new_table = calloc(str_size, 1)) == NULL)
+                   _nc_err_abort(MSG_NO_MEMORY);
            }
        }
     } else {
index 8acdbdd4eafc64e89e57b1b5d67994634be521d4..ff8d5657a197a8f194b684864e8d9e0a4a1e87f1 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.123 2022/09/03 20:02:45 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.124 2022/09/10 19:54:59 tom Exp $")
 
 static void sanity_check2(TERMTYPE2 *, bool);
 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -252,6 +252,7 @@ _nc_read_entry_source(FILE *fp, char *buf,
            FreeIfNeeded(thisentry.tterm.Booleans);
            FreeIfNeeded(thisentry.tterm.Numbers);
            FreeIfNeeded(thisentry.tterm.Strings);
+           FreeIfNeeded(thisentry.tterm.str_table);
 #if NCURSES_XNAMES
            FreeIfNeeded(thisentry.tterm.ext_Names);
            FreeIfNeeded(thisentry.tterm.ext_str_table);
@@ -412,7 +413,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
        int matchcount = 0;
 
        for_entry_list(rp) {
-           if (qp > rp
+           if (qp > rp // FIXME - pointer-comparison is wrong...
                && check_collisions(qp->tterm.term_names,
                                    rp->tterm.term_names,
                                    matchcount + 1)) {
index b6f2a75e5ed3ee0a821a8bde2768f81261b6cc79..effd3c1c158e2675dbdff506a750c9f4bc377265 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_trace.c,v 1.100 2022/07/23 20:08:45 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.101 2022/09/17 14:57:02 tom Exp $")
 
 NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
 
@@ -108,8 +108,33 @@ NCURSES_EXPORT(unsigned)
 curses_trace(unsigned tracelevel)
 {
     unsigned result;
+
 #if defined(TRACE)
+    int bit;
+
+#define DATA(name) { name, #name }
+    static struct {
+       unsigned mask;
+       const char *name;
+    } trace_names[] = {
+       DATA(TRACE_TIMES),
+           DATA(TRACE_TPUTS),
+           DATA(TRACE_UPDATE),
+           DATA(TRACE_MOVE),
+           DATA(TRACE_CHARPUT),
+           DATA(TRACE_CALLS),
+           DATA(TRACE_VIRTPUT),
+           DATA(TRACE_IEVENT),
+           DATA(TRACE_BITS),
+           DATA(TRACE_ICALLS),
+           DATA(TRACE_CCALLS),
+           DATA(TRACE_DATABASE),
+           DATA(TRACE_ATTRS)
+    };
+#undef DATA
+
     Locked(result = _nc_tracing);
+
     if ((MyFP == 0) && tracelevel) {
        MyInit = TRUE;
        if (MyFD >= 0) {
@@ -151,6 +176,24 @@ curses_trace(unsigned tracelevel)
                NCURSES_VERSION,
                NCURSES_VERSION_PATCH,
                tracelevel);
+
+#define SPECIAL_MASK(mask) \
+           if ((tracelevel & mask) == mask) \
+               _tracef("- %s (%u)", #mask, mask)
+
+       for (bit = 0; bit < TRACE_SHIFT; ++bit) {
+           unsigned mask = (1U << bit) & tracelevel;
+           if ((mask & trace_names[bit].mask) != 0) {
+               _tracef("- %s (%u)", trace_names[bit].name, mask);
+           }
+       }
+       SPECIAL_MASK(TRACE_MAXIMUM);
+       else
+       SPECIAL_MASK(TRACE_ORDINARY);
+
+       if (tracelevel > TRACE_MAXIMUM) {
+           _tracef("- DEBUG_LEVEL(%u)", tracelevel >> TRACE_SHIFT);
+       }
     } else if (tracelevel == 0) {
        if (MyFP != 0) {
            MyFD = dup(MyFD);   /* allow reopen of same file */
index 4569793de2bfbc5813913e7c8e6975d7e984bded..3fee82a97ce7625f092f94314eb4f0ddb628b086 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220910) unstable; urgency=low
+ncurses6 (6.3+20220917) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Sep 2022 05:26:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Sep 2022 06:53:31 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 4569793de2bfbc5813913e7c8e6975d7e984bded..3fee82a97ce7625f092f94314eb4f0ddb628b086 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220910) unstable; urgency=low
+ncurses6 (6.3+20220917) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Sep 2022 05:26:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Sep 2022 06:53:31 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index d93cef9d35d266fb4fce1e2717140428a7352099..aacb3e5292e9ec45beca0df233be4c22c1f5a0fb 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220910) unstable; urgency=low
+ncurses6 (6.3+20220917) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Sep 2022 05:26:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Sep 2022 06:53:31 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index b6b505e312cc28ef89cb70b0b3d5845e8bb926aa..c291ccf51c16832e7e3abf84d8ffa9796d35faee 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.541 2022/09/10 09:26:46 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.542 2022/09/17 10:53:30 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  "0910"\r
+!define VERSION_MMDD  "0917"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 5bf47139812e54451704bc8e5848125e25b75f4c..9b8ce6af10d4df6678ff7dc1f6dbae033608bffa 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
-Release: 20220910
+Release: 20220917
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index b571b10aea79bf5f64c2d12c4216ed4f5f787bad..27e879989e482692e9dd539972ada4dc57fa185f 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
-Release: 20220910
+Release: 20220917
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index c2ec62a30c2dd743f421a5c15456499bf18d1393..0141bc166973fde02d868851a0542ebf2be635f9 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
-Release: 20220910
+Release: 20220917
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index e6498db03a72978cfe978cc717ae43b2a0661eb3..84b46c01270a9c9ec89b9a3bb90d1a05922f0278 100644 (file)
@@ -31,7 +31,7 @@
  *  Author: Thomas E. Dickey                    1997-on                     *
  ****************************************************************************/
 /*
- * $Id: progs.priv.h,v 1.55 2022/09/10 21:47:39 tom Exp $
+ * $Id: progs.priv.h,v 1.58 2022/09/17 18:58:05 tom Exp $
  *
  *     progs.priv.h
  *
@@ -147,8 +147,6 @@ extern int optind;
 #endif
 #endif
 
-#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
-
 /* error-returns for tput */
 #define ErrUsage       2
 #define ErrTermType    3
@@ -234,8 +232,22 @@ extern int optind;
 
 #define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
 
+#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
+
+/*
+ * If configured for tracing, the debug- and trace-output are merged together
+ * in the trace file for "upper" levels of the verbose option.
+ */
 #ifdef TRACE
-#define use_verbosity(level) do { set_trace_level(level); if (_nc_tracing > DEBUG_LEVEL(2)) _nc_tracing |= TRACE_MAXIMUM; } while (0)
+#define use_verbosity(level) do { \
+               set_trace_level(level); \
+               if (_nc_tracing > DEBUG_LEVEL(2)) \
+                   _nc_tracing |= TRACE_MAXIMUM; \
+               else if (_nc_tracing == DEBUG_LEVEL(2)) \
+                   _nc_tracing |= TRACE_ORDINARY; \
+               if (level >= 2) \
+                   curses_trace(_nc_tracing); \
+       } while (0)
 #else
 #define use_verbosity(level) do { set_trace_level(level); } while (0)
 #endif
index cb7baf07715b98c60b323b2f5200e9a6b9fb9978..93a0b4916e269ffbd3648ebc137d5a5990044520 100644 (file)
@@ -49,7 +49,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.318 2022/09/03 23:29:16 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.320 2022/09/17 18:55:28 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -722,7 +722,8 @@ main(int argc, char *argv[])
        sortmode = S_TERMCAP;
     }
 #if NCURSES_XNAMES
-    use_extended_names(FALSE);
+    /* set this directly to avoid interaction with -v and -D options */
+    _nc_user_definable = FALSE;
 #endif
     _nc_strict_bsd = 0;
 
@@ -853,7 +854,6 @@ main(int argc, char *argv[])
            _nc_disable_period = TRUE;
            /* FALLTHRU */
        case 'x':
-           use_extended_names(TRUE);
            using_extensions = TRUE;
            break;
 #endif
@@ -863,9 +863,24 @@ main(int argc, char *argv[])
        last_opt = this_opt;
     }
 
+    /*
+     * If the -v option is set, it may override the $NCURSES_TRACE environment
+     * variable, e.g., for -v3 and up.
+     */
     debug_level = VtoTrace(v_opt);
     use_verbosity(debug_level);
 
+    /*
+     * Do this after setting debug_level, since the function calls START_TRACE,
+     * which uses the $NCURSES_TRACE environment variable if _nc_tracing bits
+     * for tracing are zero.
+     */
+#if NCURSES_XNAMES
+    if (using_extensions) {
+       use_extended_names(TRUE);
+    }
+#endif
+
     if (_nc_tracing) {
        save_check_termtype = _nc_check_termtype2;
        _nc_check_termtype2 = check_termtype;