From: Thomas E. Dickey Date: Sun, 25 Mar 2018 00:33:35 +0000 (+0000) Subject: ncurses 6.1 - patch 20180324 X-Git-Tag: v6.2~95 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=073e4446d2def7ebf1f0ff4f124f0c8d4af0b788 ncurses 6.1 - patch 20180324 + amend Scaled256() macro in test/picsmap.c to cover the full range 0..1000 (report by Roger Pau Monne). + add some checks in tracemunch for undefined variables. --- diff --git a/NEWS b/NEWS index d9a731f8..8445a672 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3102 2018/03/17 19:47:51 tom Exp $ +-- $Id: NEWS,v 1.3105 2018/03/24 22:56:36 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,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. +20180324 + + amend Scaled256() macro in test/picsmap.c to cover the full range + 0..1000 (report by Roger Pau Monne). + + add some checks in tracemunch for undefined variables. + 20180317 + fix a check in infotocap which may not have detected a problem when it should have. diff --git a/VERSION b/VERSION index 533a2416..2b9113df 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20180317 +5:0:10 6.1 20180324 diff --git a/dist.mk b/dist.mk index e084cb36..7cb0febf 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1215 2018/03/17 16:49:57 tom Exp $ +# $Id: dist.mk,v 1.1216 2018/03/22 08:41:45 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 1 -NCURSES_PATCH = 20180317 +NCURSES_PATCH = 20180324 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 500b2464..4141200e 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20180317) unstable; urgency=low +ncurses6 (6.1+20180324) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 17 Mar 2018 12:49:57 -0400 + -- Thomas E. Dickey Thu, 22 Mar 2018 04:41:45 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 500b2464..4141200e 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20180317) unstable; urgency=low +ncurses6 (6.1+20180324) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 17 Mar 2018 12:49:57 -0400 + -- Thomas E. Dickey Thu, 22 Mar 2018 04:41:45 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index b4cdb231..24a4e4b1 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20180317) unstable; urgency=low +ncurses6 (6.1+20180324) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 17 Mar 2018 12:49:57 -0400 + -- Thomas E. Dickey Thu, 22 Mar 2018 04:41:45 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 7128fedc..5b55bb94 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.262 2018/03/17 16:49:57 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.263 2018/03/22 08:41:45 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "1" !define VERSION_YYYY "2018" -!define VERSION_MMDD "0317" +!define VERSION_MMDD "0324" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 39799961..b5144210 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.1 -Release: 20180317 +Release: 20180324 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 0866fd36..f285cf0d 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.1 -Release: 20180317 +Release: 20180324 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/picsmap.c b/test/picsmap.c index a1865182..4e5b2634 100644 --- a/test/picsmap.c +++ b/test/picsmap.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: picsmap.c,v 1.117 2018/02/12 09:57:31 tom Exp $ + * $Id: picsmap.c,v 1.118 2018/03/24 22:37:42 tom Exp $ * * Author: Thomas E. Dickey * @@ -71,10 +71,12 @@ #define L_CURLY '{' #define R_CURLY '}' +#define MaxSCALE 1000 /* input curses ranges 0..1000 */ +#define MaxRGB 255 /* output color ranges 0..255 */ #define okCOLOR(n) ((n) >= 0 && (n) < COLORS) -#define okRGB(n) ((n) >= 0 && (n) <= 1000) -#define Scaled256(n) (NCURSES_COLOR_T) (int)(((n) * 1000.0) / 256) -#define ScaledColor(n) (NCURSES_COLOR_T) (int)(((n) * 1000.0) / scale) +#define okSCALE(n) ((n) >= 0 && (n) <= MaxSCALE) +#define Scaled256(n) (NCURSES_COLOR_T) (int)(((double)(n) * MaxSCALE) / 255) +#define ScaledColor(n) (NCURSES_COLOR_T) (int)(((double)(n) * MaxSCALE) / scale) #ifndef RGB_PATH #define RGB_PATH "/etc/X11/rgb.txt" @@ -650,7 +652,7 @@ init_palette(const char *palette_file) if (data != 0) { int n; int red, green, blue; - int scale = 1000; + int scale = MaxSCALE; int c; for (n = 0; data[n] != 0; ++n) { if (sscanf(data[n], "scale:%d", &c) == 1) { @@ -661,9 +663,9 @@ init_palette(const char *palette_file) &green, &blue) == 4 && okCOLOR(c) - && okRGB(red) - && okRGB(green) - && okRGB(blue)) { + && okSCALE(red) + && okSCALE(green) + && okSCALE(blue)) { /* *INDENT-EQLS* */ all_colors[c].red = ScaledColor(red); all_colors[c].green = ScaledColor(green); @@ -1043,7 +1045,7 @@ parse_xbm(char **data) if (isdigit(UChar(*s))) { long value = strtol(s, &t, 0); int b; - if (t != s || value > 255 || value < 0) { + if (t != s || value > MaxRGB || value < 0) { s = t; } else { state = -1; @@ -1347,9 +1349,9 @@ parse_img(const char *filename) &check)) { if ((s - t) > 8) /* 6 hex digits vs 8 */ check /= 256; - if (r > 255 || - g > 255 || - b > 255 || + if (r > MaxRGB || + g > MaxRGB || + b > MaxRGB || check != (unsigned) ((r << 16) | (g << 8) | b)) { okay = FALSE; break; diff --git a/test/tracemunch b/test/tracemunch index 1c931432..2b7ad41a 100755 --- a/test/tracemunch +++ b/test/tracemunch @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: tracemunch,v 1.17 2017/12/23 17:51:31 tom Exp $ +# $Id: tracemunch,v 1.18 2018/03/22 08:50:15 tom Exp $ ############################################################################## # Copyright (c) 1998-2005,2017 Free Software Foundation, Inc. # # # @@ -62,19 +62,19 @@ sub transaddr { $arg =~ s/\b$stdscr\b/stdscr/g if ($stdscr); foreach my $addr ( keys %scr_addr ) { $n = $scr_addr{$addr}; - $arg =~ s/\b$addr\b/screen$n/g; + $arg =~ s/\b$addr\b/screen$n/g if ( defined $n ); } foreach my $addr ( keys %thr_addr ) { $n = $thr_addr{$addr}; - $arg =~ s/\b$addr\b/thread$n/g; + $arg =~ s/\b$addr\b/thread$n/g if ( defined $n ); } foreach my $addr ( keys %try_addr ) { $n = $try_addr{$addr}; - $arg =~ s/\b$addr\b/tries_$n/g; + $arg =~ s/\b$addr\b/tries_$n/g if ( defined $n ); } foreach my $addr ( keys %win_addr ) { $n = $win_addr{$addr}; - $arg =~ s/\b$addr\b/window$n/g; + $arg =~ s/\b$addr\b/window$n/g if ( defined $n ); } if ( $arg =~ /add_wch\((window\d+,)?0x[[:xdigit:]]+\)/i ) { $arg =~ s/(0x[[:xdigit:]]+)[)]/\&wch)/i;