ncurses 6.3 - patch 20220205

+ workaround in test/picsmap.c for use of floating point for rgb values
  by ImageMagick 6.9.11, which appears to use the wrong upper limit.
+ improve use of "trap" in shell scripts, using "fixup-trap".
This commit is contained in:
Thomas E. Dickey 2022-02-06 01:46:24 +00:00
parent 95b3f94ec8
commit 79b07cae47
26 changed files with 1382 additions and 1304 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
# $Id: make-tar.sh,v 1.20 2021/10/12 21:11:33 tom Exp $
# $Id: make-tar.sh,v 1.21 2022/02/05 17:57:20 tom Exp $
##############################################################################
# Copyright 2019-2020,2021 Thomas E. Dickey #
# Copyright 2019-2021,2022 Thomas E. Dickey #
# Copyright 2010-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -84,7 +84,8 @@ fi
SOURCE=`cd ..;pwd`
BUILD=$TMPDIR/make-tar$$
trap "cd /; rm -rf $BUILD; exit 0" EXIT INT QUIT TERM HUP
trap "cd /; rm -rf $BUILD; exit 1" 1 2 3 15
trap "cd /; rm -rf $BUILD" 0
umask 077
if ! ( mkdir $BUILD )

7
NEWS
View File

@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.3774 2022/01/30 01:11:51 tom Exp $
-- $Id: NEWS,v 1.3776 2022/02/06 00:37:58 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -46,6 +46,11 @@ 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.
20220205
+ workaround in test/picsmap.c for use of floating point for rgb values
by ImageMagick 6.9.11, which appears to use the wrong upper limit.
+ improve use of "trap" in shell scripts, using "fixup-trap".
20220129
+ minor updates for test-packages
+ improve handling of --with-pkg-config-libdir option, allowing for the

View File

@ -1 +1 @@
5:0:10 6.3 20220129
5:0:10 6.3 20220205

7
aclocal.m4 vendored
View File

@ -29,7 +29,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.1003 2022/01/29 22:05:06 tom Exp $
dnl $Id: aclocal.m4,v 1.1004 2022/02/05 17:48:07 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -5740,7 +5740,7 @@ AC_ARG_WITH(manpage-tbl,
AC_MSG_RESULT($MANPAGE_TBL)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MAN_PAGES version: 51 updated: 2021/01/05 16:29:19
dnl CF_MAN_PAGES version: 52 updated: 2022/02/05 12:31:08
dnl ------------
dnl Try to determine if the man-pages on the system are compressed, and if
dnl so, what format is used. Use this information to construct a script that
@ -5813,7 +5813,8 @@ INSTALL_DATA="$INSTALL_DATA"
transform="$program_transform_name"
TMP=\${TMPDIR:=/tmp}/man\$\$
trap "rm -f \$TMP" 0 1 2 3 15
trap "rm -f \$TMP; exit 1" 1 2 3 15
trap "rm -f \$TMP" 0
form=\[$]1
shift || exit 1

16
config.guess vendored
View File

@ -1,14 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2021 Free Software Foundation, Inc.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2021-06-03'
timestamp='2022-01-09'
# 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
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@ -60,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2021 Free Software Foundation, Inc.
Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -437,7 +437,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
# This test works for both compilers.
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
@ -929,6 +929,9 @@ EOF
i*:PW*:*)
GUESS=$UNAME_MACHINE-pc-pw32
;;
*:SerenityOS:*:*)
GUESS=$UNAME_MACHINE-pc-serenity
;;
*:Interix*:*)
case $UNAME_MACHINE in
x86)
@ -1522,6 +1525,9 @@ EOF
i*86:rdos:*:*)
GUESS=$UNAME_MACHINE-pc-rdos
;;
i*86:Fiwix:*:*)
GUESS=$UNAME_MACHINE-pc-fiwix
;;
*:AROS:*:*)
GUESS=$UNAME_MACHINE-unknown-aros
;;

20
config.sub vendored
View File

@ -1,14 +1,14 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2021 Free Software Foundation, Inc.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2021-08-14'
timestamp='2022-01-03'
# 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
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2021 Free Software Foundation, Inc.
Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -1020,6 +1020,11 @@ case $cpu-$vendor in
;;
# Here we normalize CPU types with a missing or matching vendor
armh-unknown | armh-alt)
cpu=armv7l
vendor=alt
basic_os=${basic_os:-linux-gnueabihf}
;;
dpx20-unknown | dpx20-bull)
cpu=rs6000
vendor=bull
@ -1121,7 +1126,7 @@ case $cpu-$vendor in
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
arm64-*)
arm64-* | aarch64le-*)
cpu=aarch64
;;
@ -1304,7 +1309,7 @@ esac
if test x$basic_os != x
then
# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
# set os.
case $basic_os in
gnu/linux*)
@ -1748,7 +1753,8 @@ case $os in
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
| fiwix* )
;;
# This one is extra strict with allowed versions
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)

2469
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1464 2022/01/29 12:21:50 tom Exp $
# $Id: dist.mk,v 1.1465 2022/02/05 11:10:39 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 = 20220129
NCURSES_PATCH = 20220205
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,7 +1,7 @@
#! /bin/sh
# $Id: MKkey_defs.sh,v 1.21 2020/08/17 10:45:33 tom Exp $
# $Id: MKkey_defs.sh,v 1.22 2022/02/05 20:38:31 tom Exp $
##############################################################################
# Copyright 2019,2020 Thomas E. Dickey #
# Copyright 2019-2020,2022 Thomas E. Dickey #
# Copyright 2001-2013,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -44,7 +44,8 @@ pass1=pass1_$$
pass2=pass2_$$
pass3=pass3_$$
pass4=pass4_$$
trap 'rm -f $data pass[1234]_$$' EXIT INT QUIT TERM HUP
trap 'rm -f $data pass[1234]_$$; exit 1' 1 2 3 15
trap 'rm -f $data pass[1234]_$$' 0
# change repeated tabs (used for readability) to single tabs (needed to make
# awk see the right field alignment of the corresponding columns):

View File

@ -1,7 +1,7 @@
#!/bin/sh
# $Id: edit_cfg.sh,v 1.14 2020/02/02 23:34:34 tom Exp $
# $Id: edit_cfg.sh,v 1.15 2022/02/05 20:38:40 tom Exp $
##############################################################################
# Copyright 2020 Thomas E. Dickey #
# Copyright 2020,2022 Thomas E. Dickey #
# Copyright 1998-2001,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -39,7 +39,8 @@
#
BAK=save$$
TMP=edit$$
trap "rm -f $BAK $TMP" 0 1 2 3 15
trap "rm -f $BAK $TMP; exit 1" 1 2 3 15
trap "rm -f $BAK $TMP" 0
for name in \
HAVE_TCGETATTR \
HAVE_TERMIOS_H \

View File

@ -1,7 +1,7 @@
#!/bin/sh
# $Id: make_sed.sh,v 1.13 2021/12/25 17:39:16 tom Exp $
# $Id: make_sed.sh,v 1.14 2022/02/05 20:38:54 tom Exp $
##############################################################################
# Copyright 2020,2021 Thomas E. Dickey #
# Copyright 2020-2021,2022 Thomas E. Dickey #
# Copyright 1998-2005,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -46,7 +46,8 @@ UPPER=upper$$
SCRIPT=script$$
RESULT=result$$
rm -f $UPPER $SCRIPT $RESULT
trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0 1 2 3 15
trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT; exit 1" 1 2 3 15
trap "rm -f $COL.* $INPUT $UPPER $SCRIPT $RESULT" 0
fgrep -v \# $1 | \
sed -e 's/[ ][ ]*/ /g' >$INPUT

View File

@ -2,10 +2,10 @@
#
# MKlib_gen.sh -- generate sources from curses.h macro definitions
#
# ($Id: MKlib_gen.sh,v 1.71 2021/09/26 22:08:53 tom Exp $)
# ($Id: MKlib_gen.sh,v 1.72 2022/02/05 20:39:10 tom Exp $)
#
##############################################################################
# Copyright 2018-2020,2021 Thomas E. Dickey #
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 1998-2016,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -101,7 +101,8 @@ ED4=sed4_${PID}.sed
AW1=awk1_${PID}.awk
AW2=awk2_${PID}.awk
TMP=gen__${PID}.c
trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 3 15
trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP; exit 1" 1 2 3 15
trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0
ALL=$USE
if test "$USE" = implemented ; then

View File

@ -1,7 +1,7 @@
#! /bin/sh
# $Id: MKkeys_list.sh,v 1.7 2020/02/02 23:34:34 tom Exp $
# $Id: MKkeys_list.sh,v 1.8 2022/02/05 20:40:20 tom Exp $
##############################################################################
# Copyright 2019,2020 Thomas E. Dickey #
# Copyright 2019-2020,2022 Thomas E. Dickey #
# Copyright 2001-2003,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -44,7 +44,8 @@ else
fi
data=data$$
trap 'rm -f $data' EXIT INT QUIT TERM HUP
trap 'rm -f $data; exit 1' 1 2 3 15
trap 'rm -f $data' 0
cat $DATA | sed -e 's/[ ][ ]*/ /g' >$data
cat <<EOF

View File

@ -30,7 +30,7 @@
#
# Author: Thomas E. Dickey, 1997-on
#
# $Id: MKexpanded.sh,v 1.23 2021/06/17 21:26:02 tom Exp $
# $Id: MKexpanded.sh,v 1.24 2022/02/05 17:27:18 tom Exp $
#
# Script to generate 'expanded.c', a dummy source that contains functions
# corresponding to complex macros used in this library. By making functions,
@ -49,7 +49,8 @@ else
fi
TMP=gen$$.c
trap "rm -f $TMP" EXIT INT QUIT TERM HUP
trap "rm -f $TMP; exit 1" 1 2 3 15
trap "rm -f $TMP" 0
cat <<EOF
/* generated by MKexpanded.sh */

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220129) unstable; urgency=low
ncurses6 (6.3+20220205) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Jan 2022 07:21:50 -0500
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 05 Feb 2022 06:10:39 -0500
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220129) unstable; urgency=low
ncurses6 (6.3+20220205) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Jan 2022 07:21:50 -0500
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 05 Feb 2022 06:10:39 -0500
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220129) unstable; urgency=low
ncurses6 (6.3+20220205) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Jan 2022 07:21:49 -0500
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 05 Feb 2022 06:10:39 -0500
ncurses6 (5.9-20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.504 2022/01/29 12:21:50 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.505 2022/02/05 11:10:39 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 "0129"
!define VERSION_MMDD "0205"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"

View File

@ -3,7 +3,7 @@
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.3
Release: 20220129
Release: 20220205
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,7 +1,7 @@
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.3
Release: 20220129
Release: 20220205
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,7 +1,7 @@
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.3
Release: 20220129
Release: 20220205
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,10 +1,10 @@
#!/bin/sh
# $Id: MKtermsort.sh,v 1.16 2021/04/18 20:12:50 tom Exp $
# $Id: MKtermsort.sh,v 1.17 2022/02/05 20:39:41 tom Exp $
#
# MKtermsort.sh -- generate indirection vectors for the various sort methods
#
##############################################################################
# Copyright 2020,2021 Thomas E. Dickey #
# Copyright 2020-2021,2022 Thomas E. Dickey #
# Copyright 1998-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -47,7 +47,7 @@ AWK=${1-awk}
DATA=${2-../include/Caps}
data=data$$
trap 'rm -f $data' 1 2 3 15
trap 'rm -f $data; exit 1' 1 2 3 15
sed -e 's/[ ][ ]*/ /g' < "$DATA" >$data
DATA=$data

View File

@ -1,6 +1,6 @@
#!/bin/sh
##############################################################################
# Copyright 2019-2020,2021 Thomas E. Dickey #
# Copyright 2019-2021,2022 Thomas E. Dickey #
# Copyright 1998-2011,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -27,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: capconvert,v 1.10 2021/09/04 10:55:04 tom Exp $
# $Id: capconvert,v 1.11 2022/02/05 20:39:49 tom Exp $
#
# capconvert -- automated conversion from termcap to terminfo
#
@ -206,7 +206,8 @@ echo "OK, now I will make your private terminfo tree. This may take a bit..."
#
# Kluge alert: we compile terminfo.src in two pieces because a lot of machines
# with < 16MB RAM choke on tic's core-hog habits.
trap "rm -f tsplit$$.*" EXIT INT QUIT TERM HUP
trap "rm -f tsplit$$.*; exit 1" 1 2 3 15
trap "rm -f tsplit$$.*" 0
sed -n $master \
-e '1,/SPLIT HERE/w 'tsplit$$.01 \
-e '/SPLIT HERE/,$w 'tsplit$$.02 \

View File

@ -1,7 +1,7 @@
#!/bin/sh
# $Id: make-tar.sh,v 1.18 2021/10/12 21:12:16 tom Exp $
# $Id: make-tar.sh,v 1.19 2022/02/05 17:57:45 tom Exp $
##############################################################################
# Copyright 2019-2020,2021 Thomas E. Dickey #
# Copyright 2019-2021,2022 Thomas E. Dickey #
# Copyright 2010-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -84,7 +84,8 @@ fi
SOURCE=`cd ..;pwd`
BUILD=$TMPDIR/make-tar$$
trap "cd /; rm -rf $BUILD; exit 0" EXIT INT QUIT TERM HUP
trap "cd /; rm -rf $BUILD; exit 0" 1 2 3 15
trap "cd /; rm -rf $BUILD; exit 0" 0
umask 077
if ! ( mkdir $BUILD )

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -27,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
* $Id: picsmap.c,v 1.139 2021/05/08 15:56:05 tom Exp $
* $Id: picsmap.c,v 1.142 2022/02/06 01:44:34 tom Exp $
*
* Author: Thomas E. Dickey
*
@ -797,6 +797,7 @@ match_c(const char *source, const char *pattern, ...)
int ch;
int *ip;
char *cp;
float *fp;
long lv;
va_start(ap, pattern);
@ -810,10 +811,13 @@ match_c(const char *source, const char *pattern, ...)
continue;
}
/* %c, %d, %s are like sscanf except for special treatment of blanks */
if (ch == '%' && *pattern != '\0' && strchr("cdnsx", *pattern)) {
if (ch == '%' && *pattern != '\0' && strchr("%cdnfsx", *pattern)) {
bool found = FALSE;
ch = *pattern++;
switch (ch) {
case '%':
source++;
break;
case 'c':
cp = va_arg(ap, char *);
do {
@ -832,6 +836,29 @@ match_c(const char *source, const char *pattern, ...)
goto finish;
}
break;
case 'f':
/* floating point for pixels... */
fp = va_arg(ap, float *);
lv = strtol(source, &cp, 10);
if (cp == 0 || cp == source)
goto finish;
*fp = (float) lv;
source = cp;
if (*source == '.') {
lv = strtol(++source, &cp, 10);
if (cp == 0 || cp == source)
goto finish;
{
float scale = 1.0f;
int digits = (int) (cp - source);
while (digits-- > 0) {
scale *= 10.0f;
}
*fp += (float) lv / scale;
}
source = cp;
}
break;
case 'n':
/* not really sscanf... */
limit = *va_arg(ap, int *);
@ -1346,11 +1373,17 @@ parse_img(const char *filename)
break;
}
} else {
/* subsequent lines begin "col,row: (r,g,b,a) #RGB" */
/*
* subsequent lines begin "col,row: (r,g,b,a) #RGB".
* Those r/g/b could be integers (0..255) or float-percentages.
*/
int r, g, b, nocolor;
float rf, gf, bf;
unsigned check;
char *t;
char *s = t = strchr(buffer, '#');
bool matched = FALSE;
bool blurred = FALSE;
if (s != 0) {
/* after the "#RGB", there are differences - just ignore */
@ -1363,14 +1396,30 @@ parse_img(const char *filename)
&col, &row,
&r, &g, &b, &nocolor,
&check)) {
matched = TRUE;
} else if (match_c(buffer,
"%d,%d: (%f%%,%f%%,%f%%,%d) #%x ",
&col, &row,
&rf, &gf, &bf, &nocolor,
&check)) {
matched = TRUE;
blurred = TRUE; /* 6.9.11 scaling is broken... */
#define fp_fix(n) (int) (MaxRGB * (((n) > 100.0 ? 100.0 : (n)) / 100.0))
r = fp_fix(rf);
g = fp_fix(gf);
b = fp_fix(bf);
}
if (matched) {
int which, c;
if ((s - t) > 8) /* 6 hex digits vs 8 */
check /= 256;
if (r > MaxRGB ||
g > MaxRGB ||
b > MaxRGB ||
check != (unsigned) ((r << 16) | (g << 8) | b)) {
if (blurred) {
/* revisit this when ImageMagick is fixed */
} else if (r > MaxRGB ||
g > MaxRGB ||
b > MaxRGB ||
check != (unsigned) ((r << 16) | (g << 8) | b)) {
okay = FALSE;
break;
}

View File

@ -1,6 +1,6 @@
#!/bin/sh
##############################################################################
# Copyright 2020 Thomas E. Dickey #
# Copyright 2020,2022 Thomas E. Dickey #
# Copyright 2007-2009,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -27,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: savescreen.sh,v 1.6 2020/02/02 23:34:34 tom Exp $
# $Id: savescreen.sh,v 1.7 2022/02/05 17:58:06 tom Exp $
#
# Use this script to exercise "savescreen".
# It starts by generating a series of temporary-filenames, which are passed
@ -37,7 +37,8 @@
# "mktemp -d" would be preferable, but is not standard.
MY_DIR=$TMPDIR/savescreen$$
trap "rm -rf $MY_DIR" EXIT INT QUIT HUP
trap "rm -rf $MY_DIR; exit 1" 1 2 3
trap "rm -rf $MY_DIR" 0
umask 077
mkdir $MY_DIR || exit 1