]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.2 - patch 20210612
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 13 Jun 2021 01:18:49 +0000 (01:18 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 13 Jun 2021 01:18:49 +0000 (01:18 +0000)
+ fixes for scan-build, valgrind build/testing.
+ update config.guess

16 files changed:
NEWS
VERSION
config.guess
dist.mk
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/dump_entry.c
progs/infocmp.c
test/move_field.c
test/padview.c
test/view.c

diff --git a/NEWS b/NEWS
index efbbf5c0d7ba6a9004f63115131fb36e469fce19..3265d19f5cd917ce718fbe6038636205362dce39 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.3671 2021/06/05 23:45:46 tom Exp $
+-- $Id: NEWS,v 1.3673 2021/06/13 00:16:30 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.
 
+20210612
+       + fixes for scan-build, valgrind build/testing.
+       + update config.guess
+
 20210605
        + add a summary of ncurses-specific preprocessor symbols to curses.h
          (prompted by discussion with Peter Farley, Bill Gray).
diff --git a/VERSION b/VERSION
index 3a8bdb0c12ed6f4cb2477dfbdf8f49942f1da50f..9c6a61347dd964a58ef50301bcd65c0a318ec272 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20210605
+5:0:10 6.2     20210612
index ec94a102b01662496cd1cd4907c16f8999f55bfa..9c65c6c1b9abee4b00ea4e2a2942029752ada114 100755 (executable)
@@ -3,7 +3,7 @@
 #   Copyright 2021 Thomas E. Dickey
 #   Copyright 1992-2021 Free Software Foundation, Inc.
 
-timestamp='2021-04-21'
+timestamp='2021-05-24'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -137,7 +137,7 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "$UNAME_SYSTEM" in
+case $UNAME_SYSTEM in
 Linux|GNU|GNU/*)
        LIBC=unknown
 
@@ -177,7 +177,7 @@ esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -193,7 +193,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
            /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
            /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
            echo unknown)`
-       case "$UNAME_MACHINE_ARCH" in
+       case $UNAME_MACHINE_ARCH in
            aarch64eb) machine=aarch64_be-unknown ;;
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
@@ -209,7 +209,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently (or will in the future) and ABI.
-       case "$UNAME_MACHINE_ARCH" in
+       case $UNAME_MACHINE_ARCH in
            earm*)
                os=netbsdelf
                ;;
@@ -230,7 +230,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
                ;;
        esac
        # Determine ABI tags.
-       case "$UNAME_MACHINE_ARCH" in
+       case $UNAME_MACHINE_ARCH in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
                abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
@@ -241,7 +241,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "$UNAME_VERSION" in
+       case $UNAME_VERSION in
            Debian*)
                release='-gnu'
                ;;
@@ -301,6 +301,8 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo mips-dec-osf1
        exit ;;
     alpha:OSF1:*:*)
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       trap '' 0
        case $UNAME_RELEASE in
        *4.0)
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -314,7 +316,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        # covers most systems running today.  This code pipes the CPU
        # types through head -n 1, so we only detect the type of CPU 0.
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-       case "$ALPHA_CPU_TYPE" in
+       case $ALPHA_CPU_TYPE in
            "EV4 (21064)")
                UNAME_MACHINE=alpha ;;
            "EV4.5 (21064)")
@@ -352,10 +354,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
-       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-       exitcode=$?
-       trap '' 0
-       exit $exitcode ;;
+       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
        exit ;;
@@ -436,7 +435,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
        echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:*:*)
-       case "`/usr/bin/arch -k`" in
+       case `/usr/bin/arch -k` in
            Series*|S4*)
                UNAME_RELEASE=`uname -v`
                ;;
@@ -450,7 +449,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
-       case "`/bin/arch`" in
+       case `/bin/arch` in
            sun3)
                echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
@@ -666,18 +665,18 @@ EOF
        exit ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
-       case "$UNAME_MACHINE" in
+       case $UNAME_MACHINE in
            9000/31?)            HP_ARCH=m68000 ;;
            9000/[34]??)         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
                if test -x /usr/bin/getconf; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                   case "$sc_cpu_version" in
+                   case $sc_cpu_version in
                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
                      532)                      # CPU_PA_RISC2_0
-                       case "$sc_kernel_bits" in
+                       case $sc_kernel_bits in
                          32) HP_ARCH=hppa2.0n ;;
                          64) HP_ARCH=hppa2.0w ;;
                          '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
@@ -878,7 +877,7 @@ EOF
        exit ;;
     *:FreeBSD:*:*)
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       case "$UNAME_PROCESSOR" in
+       case $UNAME_PROCESSOR in
            amd64)
                UNAME_PROCESSOR=x86_64 ;;
            i386)
@@ -902,7 +901,7 @@ EOF
        echo "$UNAME_MACHINE"-pc-pw32
        exit ;;
     *:Interix*:*)
-       case "$UNAME_MACHINE" in
+       case $UNAME_MACHINE in
            x86)
                echo i586-pc-interix"$UNAME_RELEASE"
                exit ;;
@@ -1439,10 +1438,9 @@ EOF
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
        # operating systems.
-       # shellcheck disable=SC2154
-       if test "$cputype" = 386; then
+       if test "${cputype-}" = 386; then
            UNAME_MACHINE=i386
-       else
+       elif test "x${cputype-}" != x; then
            UNAME_MACHINE="$cputype"
        fi
        echo "$UNAME_MACHINE"-unknown-plan9
@@ -1473,7 +1471,7 @@ EOF
        exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "$UNAME_MACHINE" in
+       case $UNAME_MACHINE in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
            V*) echo vax-dec-vms ; exit ;;
@@ -1640,7 +1638,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
 
 echo "$0: unable to guess system type" >&2
 
-case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+case $UNAME_MACHINE:$UNAME_SYSTEM in
     mips:Linux | mips64:Linux)
        # If we got here on MIPS GNU/Linux, output extra information.
        cat >&2 <<EOF
diff --git a/dist.mk b/dist.mk
index 4cb2a007f1103223d343cb771d9e7af5c2d6c047..ec472b60ecad9b369a5cfc2f7a1aa4d68f18fe42 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.1418 2021/06/05 23:45:46 tom Exp $
+# $Id: dist.mk,v 1.1419 2021/06/12 10:37:34 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 = 2
-NCURSES_PATCH = 20210605
+NCURSES_PATCH = 20210612
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index ac04dff662db50acdf7a24e71347b4763ee83442..c4511180f35193692eeb14805fc0f716fbacf3da 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210605) unstable; urgency=low
+ncurses6 (6.2+20210612) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 05 Jun 2021 19:45:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 12 Jun 2021 06:37:34 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index ac04dff662db50acdf7a24e71347b4763ee83442..c4511180f35193692eeb14805fc0f716fbacf3da 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210605) unstable; urgency=low
+ncurses6 (6.2+20210612) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 05 Jun 2021 19:45:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 12 Jun 2021 06:37:34 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index e9c84afefbb89650354e5c12c2adea02349cdb79..39b5f9042a54173bcddbed076fc35c8063e58a23 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210605) unstable; urgency=low
+ncurses6 (6.2+20210612) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 05 Jun 2021 19:45:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 12 Jun 2021 06:37:34 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index bf4730e00ba10713d58ef1e4e6c6d535a6d2f461..878b3a591a7986edebf82a43ca27fb4770e2d3f6 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.461 2021/06/05 23:45:46 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.462 2021/06/12 10:37:34 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 "2"\r
 !define VERSION_YYYY  "2021"\r
-!define VERSION_MMDD  "0605"\r
+!define VERSION_MMDD  "0612"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 5916c3ce2535fc5ed463ac8245bdcfc513ec24c3..c6054af1ed98f588729a2e5b4f6acd124276e2af 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20210605
+Release: 20210612
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index b7e86c8e9becbc65fd47d45ce28cf7def38e00a6..9c5b712d4a105a823c90da75f85a6ce61e706c4c 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210605
+Release: 20210612
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index de458e08a5c882e435ccb89b88c06e06aec175b5..725a17cfa9d93fb37465c91b9194911f5bebef5d 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210605
+Release: 20210612
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index dda1b681956a48390cb9413b3b05dd85c603b61f..9c0c8155be070d4b67d3f4660af9df3f5df53401 100644 (file)
@@ -40,7 +40,7 @@
 #include <termsort.h>          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.186 2021/04/18 11:33:08 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.187 2021/06/12 22:06:55 tom Exp $")
 
 #define DISCARD(string) string = ABSENT_STRING
 #define PRINTF (void) printf
@@ -549,7 +549,7 @@ fill_spaces(const char *src)
        if (pass) {
            result[d] = '\0';
        } else {
-           result = malloc(need + 1);
+           result = calloc(need + 1, sizeof(char));
            if (result == 0)
                failed("fill_spaces");
        }
index adc53ba0de66d9774a2b5ed6fb74b14541350a2b..e2f442b01ba45c11d99877239025e8d94c8f2373 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.149 2021/04/17 15:24:04 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.150 2021/06/12 21:52:06 tom Exp $")
 
 #define MAX_STRING     1024    /* maximum formatted string */
 
@@ -1513,6 +1513,8 @@ show_databases(void)
 
 #if NO_LEAKS
 #define MAIN_LEAKS() \
+    _nc_free_termtype2(&entries[0].tterm); \
+    _nc_free_termtype2(&entries[1].tterm); \
     free(myargv); \
     free(tfile); \
     free(tname)
index 5e7fc82e3904ace6694ce2f7a2c67065420a9369..b5ec9438513b9d6e1a5eac386b96ba5cc6aede81 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: move_field.c,v 1.8 2021/03/27 23:41:57 tom Exp $
+ * $Id: move_field.c,v 1.9 2021/06/12 21:30:34 tom Exp $
  *
  * Demonstrate move_field().
  */
@@ -395,6 +395,7 @@ do_demo(FORM *form)
                refresh();
            }
        }
+       free(old_fields);
        free(new_fields);
     }
 }
index c99fddd99078733da89469814bd47e4108c4e143..fb1d9fca176ee89329b7c172778f21dcfaf5c5a9 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * clone of view.c, using pads
  *
- * $Id: padview.c,v 1.17 2021/03/20 16:04:45 tom Exp $
+ * $Id: padview.c,v 1.18 2021/06/12 23:16:31 tom Exp $
  */
 
 #include <test.priv.h>
@@ -144,9 +144,12 @@ read_file(const char *filename)
     }
 
     len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
-    my_blob[sb.st_size] = '\0';
     fclose(fp);
 
+    if (len > (size_t) sb.st_size)
+       len = (size_t) sb.st_size;
+    my_blob[len] = '\0';
+
     for (pass = 0; pass < 2; ++pass) {
        char *base = my_blob;
        k = 0;
@@ -160,12 +163,19 @@ read_file(const char *filename)
                ++k;
            }
        }
+       if (base != (my_blob + j)) {
+           if (pass)
+               my_vec[k] = base;
+           ++k;
+       }
        num_lines = k;
-       if (base != (my_blob + j))
-           ++num_lines;
-       if (!pass &&
-           ((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
-           failed("cannot allocate line-vector #1");
+       if (pass == 0) {
+           if (((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
+               failed("cannot allocate line-vector #1");
+           }
+       } else {
+           if (my_vec[0] == NULL)
+               my_vec[0] = my_blob;
        }
     }
 
index c4c53c79a1dba1d674e163be0bd0bd42cdf10855..b368f5b728d8c0a80be0f080b789caae0aa8e64f 100644 (file)
@@ -52,7 +52,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.141 2021/05/08 15:57:04 tom Exp $
+ * $Id: view.c,v 1.142 2021/06/12 23:16:31 tom Exp $
  */
 
 #include <test.priv.h>
@@ -257,9 +257,12 @@ read_file(const char *filename)
     }
 
     len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
-    my_blob[sb.st_size] = '\0';
     fclose(fp);
 
+    if (len > (size_t) sb.st_size)
+       len = (size_t) sb.st_size;
+    my_blob[len] = '\0';
+
     for (pass = 0; pass < 2; ++pass) {
        char *base = my_blob;
        k = 0;
@@ -273,12 +276,19 @@ read_file(const char *filename)
                ++k;
            }
        }
+       if (base != (my_blob + j)) {
+           if (pass)
+               my_vec[k] = base;
+           ++k;
+       }
        num_lines = k;
-       if (base != (my_blob + j))
-           ++num_lines;
-       if (!pass &&
-           ((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
-           failed("cannot allocate line-vector #1");
+       if (pass == 0) {
+           if (((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
+               failed("cannot allocate line-vector #1");
+           }
+       } else {
+           if (my_vec[0] == NULL)
+               my_vec[0] = my_blob;
        }
     }