From aaa5142e4bdde469fbc59d1c91455cbd0c45281a Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sat, 15 Oct 2022 23:52:49 +0000 Subject: [PATCH] ncurses 6.3 - patch 20221015 + fix another memory-leak in tic. + update install-sh script from autoconf, to fix install problem for Ada95 with Arch; as noted in https://lists.gnu.org/archive/html/automake/2018-09/msg00005.html there are unaddressed issues. + update CF_XOPEN_SOURCE, adding GNU libc suffixes for abi64, abin32, x32 (report by Sven Joachim): + correct ifdef's for _nc_set_read_thread() (patch by Mikhail Korolev, cf: 20220813). --- Ada95/aclocal.m4 | 6 +- Ada95/configure | 4 +- NEWS | 13 +- VERSION | 2 +- aclocal.m4 | 6 +- configure | 2 +- dist.mk | 4 +- install-sh | 671 +++++++++++++++++++++---------- ncurses/curses.priv.h | 4 +- ncurses/tinfo/alloc_entry.c | 56 ++- ncurses/tinfo/comp_parse.c | 11 +- ncurses/tty/lib_tstp.c | 6 +- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- package/ncursest.spec | 2 +- test/aclocal.m4 | 6 +- test/configure | 2 +- 21 files changed, 556 insertions(+), 259 deletions(-) diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 5f7c5a6e..5636b3cd 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.195 2022/09/24 20:42:30 tom Exp $ +dnl $Id: aclocal.m4,v 1.196 2022/10/02 23:55:56 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -5014,7 +5014,7 @@ AC_ARG_WITH(system-type, ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 60 updated: 2022/09/10 15:16:16 +dnl CF_XOPEN_SOURCE version: 62 updated: 2022/10/02 19:55:56 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -5065,7 +5065,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) diff --git a/Ada95/configure b/Ada95/configure index ee43a442..a3561fe1 100755 --- a/Ada95/configure +++ b/Ada95/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.85 . +# From configure.in Revision: 1.86 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20210509. # @@ -12465,7 +12465,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) cf_gnu_xopen_source=$cf_XOPEN_SOURCE diff --git a/NEWS b/NEWS index 1c0ee42b..d387afe3 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3864 2022/10/08 16:50:03 tom Exp $ +-- $Id: NEWS,v 1.3868 2022/10/15 19:45:12 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,17 @@ 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. +20221015 + + fix another memory-leak in tic. + + update install-sh script from autoconf, to fix install problem for + Ada95 with Arch; as noted in + https://lists.gnu.org/archive/html/automake/2018-09/msg00005.html + there are unaddressed issues. + + update CF_XOPEN_SOURCE, adding GNU libc suffixes for abi64, abin32, + x32 (report by Sven Joachim): + + correct ifdef's for _nc_set_read_thread() (patch by Mikhail Korolev, + cf: 20220813). + 20221008 + correct a switch-statement case in configure script to allow for test builds with ABI=7. diff --git a/VERSION b/VERSION index 5c043d13..1b3acc0c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.3 20221008 +5:0:10 6.3 20221015 diff --git a/aclocal.m4 b/aclocal.m4 index bf806578..4478ba88 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.1014 2022/10/01 13:24:04 tom Exp $ +dnl $Id: aclocal.m4,v 1.1015 2022/10/02 23:55:56 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -9873,7 +9873,7 @@ fi AC_SUBST(no_x11_rgb) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 61 updated: 2022/09/30 04:05:55 +dnl CF_XOPEN_SOURCE version: 62 updated: 2022/10/02 19:55:56 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -9924,7 +9924,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|linux*gnueabi|linux*gnueabihf|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) diff --git a/configure b/configure index 128cca2a..b7a2d9a5 100755 --- a/configure +++ b/configure @@ -9989,7 +9989,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|linux*gnueabi|linux*gnueabihf|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) cf_gnu_xopen_source=$cf_XOPEN_SOURCE diff --git a/dist.mk b/dist.mk index fd35b793..dbb55b2c 100644 --- 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.1506 2022/10/08 10:25:44 tom Exp $ +# $Id: dist.mk,v 1.1507 2022/10/15 11:57:10 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 = 20221008 +NCURSES_PATCH = 20221015 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/install-sh b/install-sh index 462fa9c3..ec298b53 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,8 @@ -#! /bin/sh -# +#!/bin/sh # install - install a program, script, or datafile -# + +scriptversion=2020-11-14.01; # UTC + # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. @@ -34,261 +35,507 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. +doit=${DOITPROG-} +doit_exec=${doit:-exec} -# set DOITPROG to echo to test this script +# Put in absolute file names if you don't have them in your path; +# or use environment vars. -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} +posix_mkdir= -# put in absolute paths if you don't have them in your path; or use env. vars. +# Desired mode of installed file. +mode=0755 -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" +backupsuffix= +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done +stripcmd= -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi +src= +dst= +dir_arg= +dst_arg= -if [ x"$dir_arg" != x ]; then - dst=$src - src="" +copy_on_change=false +is_target_a_directory=possibly - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi +Options: + --help display this help and exit. + --version display version info and exit. - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi + -c (ignored) + -C install only if different (preserve data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi -fi +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` +If -S is not specified, no backups are attempted. -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ +" -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" +while test $# -ne 0; do + case $1 in + -c) ;; -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS + -C) copy_on_change=true;; -pathcomp='' + -d) dir_arg=true;; -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 - shift + -g) chgrpcmd="$chgrpprog $2" + shift;; - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi + --help) echo "$usage"; exit $?;; - pathcomp=$pathcomp/ -done -fi + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && + -o) chowncmd="$chownprog $2" + shift;; - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else + -p) cpprog="$cpprog -p";; -# If we're going to rename the final executable, determine the name now. + -s) stripcmd=$stripprog;; - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi + -S) backupsuffix="$2" + shift;; -# don't allow the sed command to completely eliminate the filename + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi + -T) is_target_a_directory=never;; -# Make a couple of temp file names in the proper directory. + --version) echo "$0 $scriptversion"; exit $?;; - dsttmp=$dstdir/#inst.$$# - rmtmp=$dstdir/#rm.$$# + --) shift + break;; -# Trap to clean up temp files at exit. + -*) echo "$0: invalid option: $1" >&2 + exit 1;; - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 + *) break;; + esac + shift +done -# Move or copy the file name to the temp name +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. - $doit $instcmd "$src" "$dsttmp" && +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi -# and set any options; do chmod last to preserve setuid bits +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi -{ - if [ -f "$dstdir/$dstfile" ] +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else - : + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi -} && - -# Now rename the file to the real destination. - - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - -fi && + trap '' 0;; + esac -# The final little trick to "correctly" pass the exit status to the exit trap. + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done -{ - (exit 0); exit -} +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 1e8ec70b..e33fd711 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -35,7 +35,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.651 2022/08/13 14:35:01 tom Exp $ + * $Id: curses.priv.h,v 1.652 2022/10/15 13:09:05 Mikhail.Korolev Exp $ * * curses.priv.h * @@ -674,7 +674,7 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *); #define _nc_unlock_global(name) /* nothing */ #endif /* USE_PTHREADS */ -#if USE_PTHREADS_EINTR || defined(EXP_WIN32_DRIVER) +#if USE_PTHREADS_EINTR extern NCURSES_EXPORT(void) _nc_set_read_thread(bool); #else #define _nc_set_read_thread(enable) /* nothing */ diff --git a/ncurses/tinfo/alloc_entry.c b/ncurses/tinfo/alloc_entry.c index 90febbbd..d5148ca6 100644 --- a/ncurses/tinfo/alloc_entry.c +++ b/ncurses/tinfo/alloc_entry.c @@ -48,7 +48,7 @@ #include -MODULE_ID("$Id: alloc_entry.c,v 1.76 2022/09/17 21:45:44 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.77 2022/10/15 19:37:33 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 @@ -251,8 +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; + size_t str_size; + char *str_table; #endif unsigned i; @@ -263,7 +263,10 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source) _nc_copy_termtype2(©, from); from = © _nc_align_termtype(to, from); - str_size += strlen(to->term_names) + 1; + /* + * compute the maximum size of the string-table. + */ + 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; @@ -303,6 +306,46 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source) to->str_table = str_table; free(from->str_table); } + /* + * Do the same for the extended-strings (i.e., lists of capabilities). + */ + str_size = 0; + for (i = 0; i < NUM_EXT_NAMES(from); ++i) { + if (VALID_STRING(from->ext_Names[i])) + str_size += strlen(from->ext_Names[i]) + 1; + } + for (i = 0; i < NUM_EXT_NAMES(to); ++i) { + if (VALID_STRING(to->ext_Names[i])) + str_size += strlen(to->ext_Names[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; + for (i = 0; i < NUM_EXT_NAMES(from); ++i) { + if (VALID_STRING(from->ext_Names[i])) { + strcpy(str_copied, from->ext_Names[i]); + from->ext_Names[i] = str_copied; + str_copied += strlen(str_copied) + 1; + } + } + for (i = 0; i < NUM_EXT_NAMES(to); ++i) { + if (VALID_STRING(to->ext_Names[i])) { + strcpy(str_copied, to->ext_Names[i]); + to->ext_Names[i] = str_copied; + str_copied += strlen(str_copied) + 1; + } + } + free(to->ext_str_table); + to->ext_str_table = str_table; + free(from->ext_str_table); + } #endif for_each_boolean(i, from) { if (to->Booleans[i] != (NCURSES_SBOOL) CANCELLED_BOOLEAN) { @@ -342,10 +385,7 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source) } } #if NCURSES_XNAMES - /* Discard the data allocated in _nc_copy_termtype2, but do not use - * _nc_free_termtype2 because that frees the string-table (which is - * not allocated by _nc_copy_termtype2). - */ + /* cleanup */ free(copy.Booleans); free(copy.Numbers); free(copy.Strings); diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 1c71eddc..c86cf59d 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -48,7 +48,7 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.127 2022/09/24 15:24:15 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.128 2022/10/15 19:31:00 tom Exp $") static void sanity_check2(TERMTYPE2 *, bool); NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; @@ -571,11 +571,10 @@ _nc_resolve_uses2(bool fullresolve, bool literal) * (reverse) order. */ for (; qp->nuses; qp->nuses--) { - validate_merge(&merged, - qp->uses[qp->nuses - 1].link); - _nc_merge_entry(&merged, - qp->uses[qp->nuses - 1].link); - free(qp->uses[qp->nuses - 1].name); + int n = qp->nuses - 1; + validate_merge(&merged, qp->uses[n].link); + _nc_merge_entry(&merged, qp->uses[n].link); + free(qp->uses[n].name); } /* diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index ec086ca7..f228f72b 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -43,7 +43,7 @@ #include -MODULE_ID("$Id: lib_tstp.c,v 1.52 2022/08/13 14:36:43 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.53 2022/10/15 13:09:05 Mikhail.Korolev Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -283,8 +283,6 @@ handle_SIGINT(int sig) _exit(EXIT_FAILURE); } -#if USE_SIGWINCH - # ifndef _nc_set_read_thread NCURSES_EXPORT(void) _nc_set_read_thread(bool enable) @@ -300,6 +298,8 @@ _nc_set_read_thread(bool enable) } # endif +#if USE_SIGWINCH + static void handle_SIGWINCH(int sig GCC_UNUSED) { diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 75a6e552..38bf5616 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20221008) unstable; urgency=low +ncurses6 (6.3+20221015) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Oct 2022 06:25:44 -0400 + -- Thomas E. Dickey Sat, 15 Oct 2022 07:57:10 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 75a6e552..38bf5616 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20221008) unstable; urgency=low +ncurses6 (6.3+20221015) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Oct 2022 06:25:44 -0400 + -- Thomas E. Dickey Sat, 15 Oct 2022 07:57:10 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 31b14a14..f0a4cea0 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.3+20221008) unstable; urgency=low +ncurses6 (6.3+20221015) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Oct 2022 06:25:44 -0400 + -- Thomas E. Dickey Sat, 15 Oct 2022 07:57:10 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 02acf867..5e966c7b 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.545 2022/10/08 10:25:44 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.546 2022/10/15 11:57:10 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "3" !define VERSION_YYYY "2022" -!define VERSION_MMDD "1008" +!define VERSION_MMDD "1015" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 7645a57c..b5e6e7ce 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.3 -Release: 20221008 +Release: 20221015 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 20f06a1a..4ee4da1a 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.3 -Release: 20221008 +Release: 20221015 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index af9e0dfa..a9b645ff 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.3 -Release: 20221008 +Release: 20221015 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/aclocal.m4 b/test/aclocal.m4 index fac04b27..88df01a2 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -27,7 +27,7 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl $Id: aclocal.m4,v 1.207 2022/09/10 19:31:11 tom Exp $ +dnl $Id: aclocal.m4,v 1.208 2022/10/02 23:55:56 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -4347,7 +4347,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 60 updated: 2022/09/10 15:16:16 +dnl CF_XOPEN_SOURCE version: 62 updated: 2022/10/02 19:55:56 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -4398,7 +4398,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) diff --git a/test/configure b/test/configure index 6cc12021..e9ac6030 100755 --- a/test/configure +++ b/test/configure @@ -4044,7 +4044,7 @@ case "$host_os" in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*gnu|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) +(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) cf_gnu_xopen_source=$cf_XOPEN_SOURCE -- 2.45.0