]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.4 - patch 20230625
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 25 Jun 2023 23:46:35 +0000 (23:46 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 25 Jun 2023 23:46:35 +0000 (23:46 +0000)
+ adjust man/make_sed.sh to work with dates as the third field of TH.
+ fixes for out-of-memory condition (report by "eaglegai").

14 files changed:
NEWS
VERSION
dist.mk
man/make_sed.sh
ncurses/tinfo/obsolete.c
ncurses/tty/hardscroll.c
ncurses/tty/hashmap.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

diff --git a/NEWS b/NEWS
index dd032a577f289b93c157a862c2a7d19b6f000b19..1e3e9f5defc73f7a71256d2d0b06123f03430a13 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.3969 2023/06/24 22:59:35 tom Exp $
+-- $Id: NEWS,v 1.3971 2023/06/25 18:16:49 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,10 @@ 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.
 
+20230625
+       + adjust man/make_sed.sh to work with dates as the third field of TH.
+       + fixes for out-of-memory condition (report by "eaglegai").
+
 20230624
        + fixes for out-of-memory condition (report by "eaglegai").
 
diff --git a/VERSION b/VERSION
index 87165874757445a9e83543580bf37a90ef1b3e3c..9a883773d0481b4e94a43ba111b01f1bc0ae7629 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.4     20230624
+5:0:10 6.4     20230625
diff --git a/dist.mk b/dist.mk
index 999e346845f2935d631332ef6f027a809fa44d0e..184921517f0507ddffef901e11dad09d1d03605c 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.1551 2023/06/24 10:06:22 tom Exp $
+# $Id: dist.mk,v 1.1552 2023/06/25 09:41:21 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 = 4
-NCURSES_PATCH = 20230624
+NCURSES_PATCH = 20230625
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 2a290f0b1d9f7e0e5752e1e2c7d737b4e86b16c7..2b9ea9f5bc54884326f59557d1f7f669bdf4fc03 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
-# $Id: make_sed.sh,v 1.16 2022/10/01 13:14:07 tom Exp $
+# $Id: make_sed.sh,v 1.17 2023/06/25 18:13:17 tom Exp $
 ##############################################################################
-# Copyright 2020-2021,2022 Thomas E. Dickey                                  #
+# Copyright 2020-2022,2023 Thomas E. Dickey                                  #
 # Copyright 1998-2005,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
@@ -69,9 +69,9 @@ sed   -e 's/^/s\/\\</' \
 echo "# Do the TH lines"
 sed    -e 's/\//\/TH /' \
        -e 's/  / /' \
-       -e 's/  / ""\/TH /' \
+       -e 's/  / \/TH /' \
        -e 's/  / /' \
-       -e 's/\/$/ ""\//' \
+       -e 's/\/$/ \//' \
        $UPPER
 
 echo "# Do the embedded references"
index e63f8a868742d4449ff83724806ade743b5c8586..869496c28f1d0e2caa26d0b56f69a7f93ecab264 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: obsolete.c,v 1.9 2023/06/24 22:02:25 tom Exp $")
+MODULE_ID("$Id: obsolete.c,v 1.10 2023/06/25 16:56:27 tom Exp $")
 
 /*
  * Obsolete entrypoint retained for binary compatibility.
@@ -252,6 +252,8 @@ _nc_conv_to_utf32(unsigned *target, const char *source, unsigned limit)
 #undef free
 #undef strdup
 
+#define TR_OOM(stmt) T(stmt)
+
 static long oom_limit = -1;
 static long oom_count = 0;
 
@@ -272,11 +274,12 @@ oom_check(void)
                oom_limit = 0;
        }
     }
+    ++oom_count;
     if (oom_limit >= 0) {
-       result = (++oom_count > oom_limit);
+       result = (oom_count > oom_limit);
        if (result && !triggered) {
            triggered = TRUE;
-           T(("out-of-memory"));
+           TR_OOM(("out-of-memory"));
        }
     }
     return result;
@@ -288,7 +291,7 @@ _nc_oom_malloc(size_t size)
     char *result = (oom_check()
                    ? NULL
                    : malloc(size));
-    T(("oom #%ld malloc(%ld) %p", oom_count, size, result));
+    TR_OOM(("oom #%ld malloc(%ld) %p", oom_count, size, result));
     return result;
 }
 
@@ -298,7 +301,7 @@ _nc_oom_calloc(size_t nmemb, size_t size)
     char *result = (oom_check()
                    ? NULL
                    : calloc(nmemb, size));
-    T(("oom #%ld calloc(%ld, %ld) %p", oom_count, nmemb, size, result));
+    TR_OOM(("oom #%ld calloc(%ld, %ld) %p", oom_count, nmemb, size, result));
     return result;
 }
 
@@ -308,14 +311,15 @@ _nc_oom_realloc(void *ptr, size_t size)
     char *result = (oom_check()
                    ? NULL
                    : realloc(ptr, size));
-    T(("oom #%ld realloc(%p, %ld) %p", oom_count, ptr, size, result));
+    TR_OOM(("oom #%ld realloc(%p, %ld) %p", oom_count, ptr, size, result));
     return result;
 }
 
 NCURSES_EXPORT(void)
 _nc_oom_free(void *ptr)
 {
-    T(("oom #%ld free(%p)", oom_count, ptr));
+    ++oom_count;
+    TR_OOM(("oom #%ld free(%p)", oom_count, ptr));
     free(ptr);
 }
 
@@ -325,7 +329,7 @@ _nc_oom_strdup(const char *ptr)
     char *result = (oom_check()
                    ? NULL
                    : strdup(ptr));
-    T(("oom #%ld strdup(%p) %p", oom_count, ptr, result));
+    TR_OOM(("oom #%ld strdup(%p) %p", oom_count, ptr, result));
     return result;
 }
 #endif /* EXP_OOM_TESTING */
index d66aa9946594b1184d8da2093c797a1c6ed2db9a..0c194b46330d9a0d475d823ee4c9b6b6d978f19b 100644 (file)
@@ -148,7 +148,7 @@ AUTHOR
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: hardscroll.c,v 1.56 2023/06/24 22:55:24 tom Exp $")
+MODULE_ID("$Id: hardscroll.c,v 1.57 2023/06/25 15:39:32 tom Exp $")
 
 #if defined(SCROLLDEBUG) || defined(HASHDEBUG)
 
@@ -307,20 +307,27 @@ NCURSES_EXPORT(void)
 NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0)
 /* dump the state of the real and virtual oldnum fields */
 {
-    char *buf = 0;
-    size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4;
-    (void) SP_PARM;
-
-    if ((buf = typeMalloc(char, want)) != 0) {
-       int n;
-
-       *buf = '\0';
-       for (n = 0; n < screen_lines(SP_PARM); n++)
-           _nc_SPRINTF(buf + strlen(buf),
-                       _nc_SLIMIT(want - strlen(buf))
-                       " %02d", OLDNUM(SP_PARM, n));
-       TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf));
-       free(buf);
+    if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) {
+       char *buf = 0;
+       size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4;
+       (void) SP_PARM;
+
+       if ((buf = typeMalloc(char, want)) != 0) {
+           int n;
+
+           *buf = '\0';
+           for (n = 0; n < screen_lines(SP_PARM); n++) {
+               int number = OLDNUM(SP_PARM, n);
+               if (number >= -99 && number < 999) {
+                   _nc_SPRINTF(buf + strlen(buf),
+                               _nc_SLIMIT(want - strlen(buf))
+                               " %02d", number);
+               } else {
+                   strcat(buf, " ??");
+               }
+           }
+           free(buf);
+       }
     }
 }
 
index 3f124c96c8968e11dad46c37ac8b7d4ea7a44e7f..2ddfaaa29b64f90b3a84f79f0326160e4c0189cf 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 2019-2020,2023 Thomas E. Dickey                                *
  * Copyright 1998-2015,2016 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -74,7 +74,7 @@ AUTHOR
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: hashmap.c,v 1.69 2020/05/31 17:50:48 tom Exp $")
+MODULE_ID("$Id: hashmap.c,v 1.70 2023/06/25 17:16:01 tom Exp $")
 
 #ifdef HASHDEBUG
 
@@ -318,8 +318,11 @@ NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0)
        if (newhash(SP_PARM) == 0)
            newhash(SP_PARM) = typeCalloc(unsigned long,
                                            (size_t) screen_lines(SP_PARM));
-       if (!oldhash(SP_PARM) || !newhash(SP_PARM))
+       if (!oldhash(SP_PARM) || !newhash(SP_PARM)) {
+           FreeAndNull(oldhash(SP_PARM));
+           FreeAndNull(newhash(SP_PARM));
            return;             /* malloc failure */
+       }
        for (i = 0; i < screen_lines(SP_PARM); i++) {
            newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i));
            oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i));
index 4356b0ebd7b2a778c42b3c6ea40e5dba2c9d18f7..0b91e886f66120476912acdf174fd3a7b13e0285 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.4+20230624) unstable; urgency=low
+ncurses6 (6.4+20230625) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 24 Jun 2023 06:06:22 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 25 Jun 2023 05:41:21 -0400
 
 ncurses6 (5.9+20131005) unstable; urgency=low
 
index 4356b0ebd7b2a778c42b3c6ea40e5dba2c9d18f7..0b91e886f66120476912acdf174fd3a7b13e0285 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.4+20230624) unstable; urgency=low
+ncurses6 (6.4+20230625) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 24 Jun 2023 06:06:22 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 25 Jun 2023 05:41:21 -0400
 
 ncurses6 (5.9+20131005) unstable; urgency=low
 
index 8783d4d06dbb414821b3ca41b797edaa5918df4f..f563a3281d8735df35bc513d42e368d37e28c8e2 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.4+20230624) unstable; urgency=low
+ncurses6 (6.4+20230625) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 24 Jun 2023 06:06:22 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 25 Jun 2023 05:41:21 -0400
 
 ncurses6 (5.9+20120608) unstable; urgency=low
 
index 7abb61605c66228193993fb400cbdd8e53318f64..fdadc5a7b021e2bf1176095332c4f7af206171d7 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.591 2023/06/24 10:06:22 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.592 2023/06/25 09:41:21 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 "4"\r
 !define VERSION_YYYY  "2023"\r
-!define VERSION_MMDD  "0624"\r
+!define VERSION_MMDD  "0625"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 822402920b938f525a068d18945cece40e03e3db..e6f9b8b444272634775fd3cf300e61fed2b15802 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.4
-Release: 20230624
+Release: 20230625
 License: X11
 Group: Development/Libraries
 URL: https://invisible-island.net/ncurses/
index 8b541eea769c0d51d4821e9d0b8f702bf124130b..6ebb0e66284c8ebd422875c4de411e83ff73d410 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.4
-Release: 20230624
+Release: 20230625
 License: X11
 Group: Development/Libraries
 URL: https://invisible-island.net/ncurses/
index dc459b77793984e09c768cc573b71023134657e7..a6e6db089cae7a490de5adab573298cb65ed4009 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.4
-Release: 20230624
+Release: 20230625
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz