]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20180317
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 18 Mar 2018 01:26:15 +0000 (01:26 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 18 Mar 2018 01:26:15 +0000 (01:26 +0000)
+ fix a check in infotocap which may not have detected a problem when
  it should have.
+ add a check in tic for the case where setf/setb are given using
  different strings, but provide identical results to setaf/setab.
+ further improve fix for terminfo.5 (patch by Kir Kolyshkin).
+ reorder loop-limit checks in winsnstr() in case the string has no
  terminating null and only the number of characters is used (patch
  by Gyorgy Jeney).

13 files changed:
NEWS
VERSION
dist.mk
include/nc_tparm.h
man/MKterminfo.sh
ncurses/base/lib_insnstr.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
progs/tic.c

diff --git a/NEWS b/NEWS
index d714ecc032c3ce45ba5f2e10b7883355bbb35700..d9a731f879dfd707c2ac9e3743b4d4146214f4d0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3096 2018/03/03 22:07:39 tom Exp $
+-- $Id: NEWS,v 1.3102 2018/03/17 19:47:51 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,16 @@ 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.
 
+20180317
+       + fix a check in infotocap which may not have detected a problem when
+         it should have.
+       + add a check in tic for the case where setf/setb are given using
+         different strings, but provide identical results to setaf/setab.
+       + further improve fix for terminfo.5 (patch by Kir Kolyshkin).
+       + reorder loop-limit checks in winsnstr() in case the string has no
+         terminating null and only the number of characters is used (patch
+         by Gyorgy Jeney).
+
 20180303
        + modify TurnOn/TurnOff macros in lib_vidattr.c and lib_vid_attr.c to
          avoid expansion of "CUR" in trace.
diff --git a/VERSION b/VERSION
index 8ef25560c6143818d6405f8164161c97073fde16..533a2416831cfd184ebfe794be51af4a63cb4e1f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20180303
+5:0:10 6.1     20180317
diff --git a/dist.mk b/dist.mk
index ea719189820cc58fb860711b14c226473006f4a6..e084cb364548ae5e83d1b6595c7178df372c7fb8 100644 (file)
--- 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.1213 2018/02/26 23:33:42 tom Exp $
+# $Id: dist.mk,v 1.1215 2018/03/17 16:49:57 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 = 20180303
+NCURSES_PATCH = 20180317
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index ed10173ab6ed9e80a60dd9d3ad051e1272326140..d2670a2bb5d4fcef71f34585eb17c07f283129be 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2012,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *  Author: Thomas E. Dickey                        2006                    *
  ****************************************************************************/
 
-/* $Id: nc_tparm.h,v 1.8 2017/07/22 17:09:46 tom Exp $ */
+/* $Id: nc_tparm.h,v 1.9 2018/03/17 19:19:58 tom Exp $ */
 
 #ifndef NC_TPARM_included
 #define NC_TPARM_included 1
@@ -73,7 +73,6 @@
 #define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0)
 #define TPARM_2(a,b,c) TPARM_3(a,b,c,0)
 #define TPARM_1(a,b) TPARM_2(a,b,0)
-#define TPARM_1(a,b) TPARM_2(a,b,0)
 #define TPARM_0(a) TPARM_1(a,0)
 #endif
 
index 1b6f89452f0266c80f222dbfdf87d2d2ba5e16e7..4d9ae18c91174ac1c58ba26a1efcde83783cf55a 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: MKterminfo.sh,v 1.15 2018/03/03 19:25:58 tom Exp $
+# $Id: MKterminfo.sh,v 1.16 2018/03/17 18:03:51 Kir.Kolyshkin Exp $
 #
 # MKterminfo.sh -- generate terminfo.5 from Caps tabular data
 #
@@ -71,7 +71,7 @@ rm -f $sorted $temp $unsorted
 sed -n <$caps "\
 /%%-STOP-HERE-%%/q
 /^#%center/s, expand,,
-/^#%lw[1-9]/s, lw[1-9][0-9]*\., l.,
+/^#%lw25/s, lw6 , lw7 ,
 /^#%/s/#%//p
 /^#/d
 s/[    ][      ]*/     /g
index d147871037e98f0228ec635985ebcace7988e714..8ee26a8091c1ef5d20140d457ed42571072fb920 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004-2009,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2004-2016,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,7 +40,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_insnstr.c,v 1.5 2016/05/28 21:03:33 tom Exp $")
+MODULE_ID("$Id: lib_insnstr.c,v 1.6 2018/03/10 20:13:59 Gyorgy.Jeney Exp $")
 
 NCURSES_EXPORT(int)
 winsnstr(WINDOW *win, const char *s, int n)
@@ -81,7 +81,7 @@ winsnstr(WINDOW *win, const char *s, int n)
            NCURSES_SIZE_T ox = win->_curx;
            const unsigned char *cp;
 
-           for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
+           for (cp = str; (n <= 0 || (cp - str) < n) && *cp; cp++) {
                _nc_insert_ch(sp, win, (chtype) UChar(*cp));
            }
            win->_curx = ox;
index 5c3da74f2f56154a11f2d353ef89f0da33d8b21f..500b2464158a99a7c0a7e62b34b08d8d41f1b995 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20180303) unstable; urgency=low
+ncurses6 (6.1+20180317) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 26 Feb 2018 18:33:42 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Mar 2018 12:49:57 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 5c3da74f2f56154a11f2d353ef89f0da33d8b21f..500b2464158a99a7c0a7e62b34b08d8d41f1b995 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20180303) unstable; urgency=low
+ncurses6 (6.1+20180317) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 26 Feb 2018 18:33:42 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Mar 2018 12:49:57 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index bd7084fa7a1690a1dc67eda0faf1325297634115..b4cdb231f51aac1f5e9c98b01a40548ecd608e19 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20180303) unstable; urgency=low
+ncurses6 (6.1+20180317) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 26 Feb 2018 18:33:42 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 17 Mar 2018 12:49:57 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 8309f99864e04155f5ee8e2f699ad3aa67b49bdb..7128fedc1ec3b046444b94b0def51eadb5a4ffa7 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.260 2018/02/26 23:33:42 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.262 2018/03/17 16:49:57 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 "1"\r
 !define VERSION_YYYY  "2018"\r
-!define VERSION_MMDD  "0303"\r
+!define VERSION_MMDD  "0317"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 3cec4c85d79a26e11c269c44fbc3db1fd8a66cc7..397999614c321f543bc61f95c10c05b5a2bb3844 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20180303
+Release: 20180317
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 364a2dfa08c533e38e1e39d6502228e311669e8b..0866fd3669b1f6558eaded6f79524f320dae7a92 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20180303
+Release: 20180317
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index da227c327adb1bb5c9a7a79684ac79c074783aa4..711ed11b9c40065c2de932da26d93b41a38b5ae0 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.252 2018/01/25 19:16:50 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.256 2018/03/18 00:05:10 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -1129,6 +1129,27 @@ check_acs(TERMTYPE2 *tp)
     }
 }
 
+static bool
+same_color(NCURSES_CONST char *oldcap, NCURSES_CONST char *newcap, int limit)
+{
+    bool result = FALSE;
+    if (limit > 16)
+       limit = 16;
+    if (limit >= 8) {
+       int n;
+       int same;
+       for (n = same = 0; n < limit; ++n) {
+           char *oldvalue = strdup(TPARM_1(oldcap, n));
+           char *newvalue = strdup(TPARM_1(newcap, n));
+           same += !strcmp(oldvalue, newvalue);
+           free(oldvalue);
+           free(newvalue);
+       }
+       result = (same == limit);
+    }
+    return result;
+}
+
 /*
  * Check if the color capabilities are consistent
  */
@@ -1145,21 +1166,29 @@ check_colors(TERMTYPE2 *tp)
     PAIRED(set_color_pair, initialize_pair);
 
     if (VALID_STRING(set_foreground)
-       && VALID_STRING(set_a_foreground)
-       && !_nc_capcmp(set_foreground, set_a_foreground))
-       _nc_warning("expected setf/setaf to be different");
+       && VALID_STRING(set_a_foreground)) {
+       if (!_nc_capcmp(set_foreground, set_a_foreground)) {
+           _nc_warning("expected setf/setaf to be different");
+       } else if (same_color(set_foreground, set_a_foreground, max_colors)) {
+           _nc_warning("setf/setaf are equivalent");
+       }
+    }
 
     if (VALID_STRING(set_background)
-       && VALID_STRING(set_a_background)
-       && !_nc_capcmp(set_background, set_a_background))
-       _nc_warning("expected setb/setab to be different");
+       && VALID_STRING(set_a_background)) {
+       if (!_nc_capcmp(set_background, set_a_background)) {
+           _nc_warning("expected setb/setab to be different");
+       } else if (same_color(set_background, set_a_background, max_colors)) {
+           _nc_warning("setb/setab are equivalent");
+       }
+    }
 
     /* see: has_colors() */
     if (VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
-       && (((set_foreground != NULL)
-            && (set_background != NULL))
-           || ((set_a_foreground != NULL)
-               && (set_a_background != NULL))
+       && ((VALID_STRING(set_foreground)
+            && VALID_STRING(set_background))
+           || (VALID_STRING(set_a_foreground)
+               && VALID_STRING(set_a_background))
            || set_color_pair)) {
        if (!VALID_STRING(orig_pair) && !VALID_STRING(orig_colors))
            _nc_warning("expected either op/oc string for resetting colors");
@@ -2075,7 +2104,7 @@ check_1_infotocap(const char *name, NCURSES_CONST char *value, int count)
                         myParam(9));
        break;
     }
-    return result;
+    return strdup(result);
 }
 
 #define IsDelay(ch) ((ch) == '.' || isdigit(UChar(ch)))
@@ -2227,7 +2256,8 @@ check_infotocap(TERMTYPE2 *tp, int i, const char *value)
            || !strcmp(name, "setb")
            || !strcmp(name, "setaf")
            || !strcmp(name, "setab")) {
-           limit = max_colors;
+           if ((limit = max_colors) > 16)
+               limit = 16;
        }
        for (count = 0; count < limit; ++count) {
            char *ti_check = check_1_infotocap(name, ti_value, count);
@@ -2243,6 +2273,8 @@ check_infotocap(TERMTYPE2 *tp, int i, const char *value)
                _nc_warning("tparm-conversion of %s(%d) differs between\n\tterminfo %s\n\ttermcap  %s",
                            name, count, ti_check, tc_check);
            }
+           free(ti_check);
+           free(tc_check);
        }
     } else if (params == 0 && !same_ti_tc(ti_value, tc_value, &embedded)) {
        if (embedded) {