]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20190209
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 10 Feb 2019 02:53:50 +0000 (02:53 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 10 Feb 2019 02:53:50 +0000 (02:53 +0000)
+ add check in tic to provide warnings for mismatched number of
  parameters in the documented user-capability extensions.

NEWS
VERSION
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/tic.c

diff --git a/NEWS b/NEWS
index 4c8eb8cb36dbef8c90eb37bba4ffa712bac02264..71f1b8d5ec244db418d92cdd358d940e2933e8cb 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.3270 2019/02/03 01:19:58 tom Exp $
+-- $Id: NEWS,v 1.3272 2019/02/10 00:56:56 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,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.
 
+20190209
+       + add check in tic to provide warnings for mismatched number of
+         parameters in the documented user-capability extensions.
+
 20190202
        + modify rpm test-package ".spec" file to work around naming conflict
          with Redhat's package for ncurses6.
diff --git a/VERSION b/VERSION
index 693476b764764cdbdf556452516b04bece177a9c..6d567fe619be12ab68bb968e9b3e39e1a5634062 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20190202
+5:0:10 6.1     20190209
diff --git a/dist.mk b/dist.mk
index 96b7b8a22d03099fa7ade65cd33463d7add8aef5..0e00ff4eb55a32aec0d30b3e2dc029c3f39d1c88 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.1265 2019/02/02 16:08:54 tom Exp $
+# $Id: dist.mk,v 1.1266 2019/02/09 15:12:47 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 = 20190202
+NCURSES_PATCH = 20190209
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 2433beac731964fa7e15e693dd0abfaf8b234064..c549a7c8ad4ce9104ee73152fb9456e674397b3c 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190202) unstable; urgency=low
+ncurses6 (6.1+20190209) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 02 Feb 2019 11:08:54 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 09 Feb 2019 10:12:47 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 2433beac731964fa7e15e693dd0abfaf8b234064..c549a7c8ad4ce9104ee73152fb9456e674397b3c 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190202) unstable; urgency=low
+ncurses6 (6.1+20190209) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 02 Feb 2019 11:08:54 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 09 Feb 2019 10:12:47 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 3468da86586e340b8abc95b184758fc2fb46f05a..07da9be82edaa047c3c5429731c6b3269f0dee7f 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190202) unstable; urgency=low
+ncurses6 (6.1+20190209) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 02 Feb 2019 11:08:54 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 09 Feb 2019 10:12:47 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 765266d47206d65496d73f7b5215864e1847e1e7..f8f3dd8a159d6e9caf924d15dbd8ff8cbbf31967 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.312 2019/02/02 16:08:54 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.313 2019/02/09 15:12:47 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  "2019"\r
-!define VERSION_MMDD  "0202"\r
+!define VERSION_MMDD  "0209"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index fa015bb552953dd27334f9c6578678eb800af4aa..e8753e1ee16e20bc6856f0e49c80853580a837c6 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20190202
+Release: 20190209
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 58e6a611b78b90b277a086df5dbf0f19f95bd9e8..6b16ccc8ed10b5372683d8599a3177dcca2ecfc5 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20190202
+Release: 20190209
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 49ffe971476998399acdbd6bdb79c2356a164d5b..c9072a0325785edaada56f9184a4fb85c2204c00 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.1
-Release: 20190202
+Release: 20190209
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 711ed11b9c40065c2de932da26d93b41a38b5ae0..9efb4b034d16bb08154cd81590eb589974da4b55 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2018,2019 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            *
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.256 2018/03/18 00:05:10 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.266 2019/02/10 02:25:46 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -59,6 +59,7 @@ static FILE *tmp_fp;
 static bool capdump = FALSE;   /* running as infotocap? */
 static bool infodump = FALSE;  /* running as captoinfo? */
 static bool showsummary = FALSE;
+static unsigned debug_level;
 static char **namelst = 0;
 static const char *to_remove;
 
@@ -680,7 +681,6 @@ main(int argc, char *argv[])
     char my_tmpname[PATH_MAX];
     char my_altfile[PATH_MAX];
     int v_opt = -1;
-    unsigned debug_level;
     int smart_defaults = TRUE;
     char *termcap;
     ENTRY *qp;
@@ -1666,28 +1666,28 @@ check_screen(TERMTYPE2 *tp)
        }
 
        if (have_XM && have_XT) {
-           _nc_warning("Screen's XT capability conflicts with XM");
+           _nc_warning("screen's XT capability conflicts with XM");
        } else if (have_XT && screen_base) {
-           _nc_warning("Screen's \"screen\" entries should not have XT set");
+           _nc_warning("screen's \"screen\" entries should not have XT set");
        } else if (have_XT) {
            if (!have_kmouse && is_screen) {
                if (VALID_STRING(key_mouse)) {
-                   _nc_warning("Value of kmous inconsistent with screen's usage");
+                   _nc_warning("value of kmous inconsistent with screen's usage");
                } else {
-                   _nc_warning("Expected kmous capability with XT");
+                   _nc_warning("expected kmous capability with XT");
                }
            }
            if (!have_bce && max_colors > 0)
-               _nc_warning("Expected bce capability with XT");
+               _nc_warning("expected bce capability with XT");
            if (!use_sgr_39_49 && have_bce && max_colors > 0)
-               _nc_warning("Expected orig_colors capability with XT to have 39/49 parameters");
+               _nc_warning("expected orig_colors capability with XT to have 39/49 parameters");
            if (VALID_STRING(to_status_line))
                _nc_warning("\"tsl\" capability is redundant, given XT");
        } else {
            if (have_kmouse
                && !have_XM
                && !screen_base && strchr(name, '+') == 0) {
-               _nc_warning("Expected XT to be set, given kmous");
+               _nc_warning("expected XT to be set, given kmous");
            }
        }
     }
@@ -1788,13 +1788,71 @@ expected_params(const char *name)
     return result;
 }
 
+typedef struct {
+    const char *name;
+    int n_type;
+    int n_parms;
+} USERCAPS;
+
 /*
+ * These are user-capabilities that happen to be used in ncurses' terminal
+ * database.
+ */
+static USERCAPS *
+lookup_user_capability(const char *name)
+{
+    /* *INDENT-OFF* */
+#define DATA(name,type,parms) { name, type, parms }
+    static USERCAPS table[] = {
+       DATA( "AX",    BOOLEAN, 0 ),
+       DATA( "Cr",    STRING,  0 ),
+       DATA( "Cs",    STRING,  1 ),
+       DATA( "E0",    STRING,  0 ),
+       DATA( "E3",    STRING,  0 ),
+       DATA( "G0",    BOOLEAN, 0 ),
+       DATA( "Ms",    STRING,  2 ),
+       DATA( "RGB",   BOOLEAN, 0 ),    /* FIXME can be number or string */
+       DATA( "S0",    STRING,  1 ),
+       DATA( "Se",    STRING,  0 ),
+       DATA( "Smulx", STRING,  1 ),
+       DATA( "Ss",    STRING,  1 ),
+       DATA( "TS",    STRING,  0 ),
+       DATA( "U8",    NUMBER,  0 ),
+       DATA( "XM",    STRING,  1 ),
+       DATA( "XT",    BOOLEAN, 0 ),
+       DATA( "grbom", STRING,  0 ),
+       DATA( "gsbom", STRING,  0 ),
+       DATA( "rmxx",  STRING,  0 ),
+       DATA( "smxx",  STRING,  0 ),
+       DATA( "xm",    STRING,  9 ),
+    };
+#undef DATA
+    /* *INDENT-ON* */
+
+    size_t n;
+    USERCAPS *result = 0;
+    if (*name != 'k') {
+       for (n = 0; n < SIZEOF(table); ++n) {
+           if (!strcmp(name, table[n].name)) {
+               result = &table[n];
+               break;
+           }
+       }
+    }
+    return result;
+}
+
+/*
+ * If a given name is likely to be a user-capability, return the number of
+ * parameters it would be used with.  If not, return -1.
+ *
  * ncurses assumes that u6 could be used for getting the cursor-position, but
  * that is not implemented.  Make a special case for that, to quiet needless
  * warnings.
  *
- * There are other string-capability extensions (see terminfo.src) which could
- * have parameters such as "Ss", "%u", but are not used by ncurses.
+ * The other string-capability extensions (see terminfo.src) which could have
+ * parameters such as "Ss", "%u", are not used by ncurses.  But we check those
+ * anyway, to validate the terminfo database.
  */
 static int
 is_user_capability(const char *name)
@@ -1802,8 +1860,14 @@ is_user_capability(const char *name)
     int result = -1;
     if (name[0] == 'u' &&
        (name[1] >= '0' && name[1] <= '9') &&
-       name[2] == '\0')
+       name[2] == '\0') {
        result = (name[1] == '6') ? 2 : 0;
+    } else if (using_extensions) {
+       USERCAPS *p = lookup_user_capability(name);
+       if (p != 0) {
+           result = p->n_parms;
+       }
+    }
     return result;
 }
 
@@ -1851,11 +1915,15 @@ check_params(TERMTYPE2 *tp, const char *name, char *value, int extended)
     }
 
     if (extended) {
-       if (actual > 0) {
-           _nc_warning("extended %s capability has %d parameters",
+       int check = is_user_capability(name);
+       if (check != actual) {
+           _nc_warning("extended %s capability has %d parameters, expected %d",
+                       name, actual, check);
+       } else if (debug_level > 1) {
+           _nc_warning("extended %s capability has %d parameters, as expected",
                        name, actual);
-           expected = actual;
        }
+       expected = actual;
     }
 
     if (params[0]) {
@@ -1889,8 +1957,8 @@ check_params(TERMTYPE2 *tp, const char *name, char *value, int extended)
            if ((user_cap == analyzed) && using_extensions) {
                ;               /* ignore */
            } else if (user_cap >= 0) {
-               _nc_warning("tparm will use %d parameters for %s",
-                           analyzed, name);
+               _nc_warning("tparm will use %d parameters for %s, expected %d",
+                           analyzed, name, user_cap);
            } else {
                _nc_warning("tparm analyzed %d parameters for %s, expected %d",
                            analyzed, name, actual);
@@ -2368,7 +2436,7 @@ similar_sgr(int num, char *a, char *b)
                    ;
                } else if (b[0] == '$'
                           && b[1] == '<') {
-                   _nc_warning("Did not find delay %s", _nc_visbuf(b));
+                   _nc_warning("did not find delay %s", _nc_visbuf(b));
                } else {
                    _nc_warning("checking sgr(%s) %s\n\tcompare to %s\n\tunmatched %s",
                                sgr_names[num], _nc_visbuf2(1, base_a),
@@ -2556,7 +2624,7 @@ check_conflict(TERMTYPE2 *tp)
                    check[k] = 1;
                    if (first) {
                        if (!conflict) {
-                           _nc_warning("Conflicting key definitions (using the last)");
+                           _nc_warning("conflicting key definitions (using the last)");
                            conflict = TRUE;
                        }
                        fprintf(stderr, "...");
@@ -2733,6 +2801,63 @@ check_sgr_param(TERMTYPE2 *tp, int code, const char *name, char *value)
     }
 }
 
+static int
+standard_type(const char *name)
+{
+    int result = -1;
+    const struct name_table_entry *np;
+
+    if ((np = _nc_find_entry(name, _nc_get_hash_table(0))) != 0) {
+       result = np->nte_type;
+    }
+    return result;
+}
+
+static const char *
+name_of_type(int type)
+{
+    const char *result = "unknown";
+    switch (type) {
+    case BOOLEAN:
+       result = "boolean";
+       break;
+    case NUMBER:
+       result = "number";
+       break;
+    case STRING:
+       result = "string";
+       break;
+    }
+    return result;
+}
+
+static void
+check_user_capability_type(const char *name, int actual)
+{
+    USERCAPS *p = lookup_user_capability(name);
+    if (p != 0) {
+       if (p->n_type != actual)
+           _nc_warning("expected %s to be %s, but actually %s",
+                       name,
+                       name_of_type(p->n_type),
+                       name_of_type(actual)
+               );
+    } else {
+       int expected = standard_type(name);
+       if (expected >= 0) {
+           _nc_warning("expected %s to be %s, but actually %s",
+                       name,
+                       name_of_type(p->n_type),
+                       name_of_type(expected)
+               );
+       } else if (*name != 'k') {
+           _nc_warning("undocumented %s capability %s",
+                       name_of_type(actual),
+                       name);
+       }
+    }
+}
+
 /* other sanity-checks (things that we don't want in the normal
  * logic that reads a terminfo entry)
  */
@@ -2752,7 +2877,7 @@ check_termtype(TERMTYPE2 *tp, bool literal)
             * check for consistent number of parameters.
             */
            if (j >= SIZEOF(parametrized) ||
-               is_user_capability(name) > 0 ||
+               is_user_capability(name) >= 0 ||
                parametrized[j] > 0) {
                check_params(tp, name, a, (j >= STRCOUNT));
            }
@@ -2762,6 +2887,18 @@ check_termtype(TERMTYPE2 *tp, bool literal)
            }
        }
     }
+#if NCURSES_XNAMES
+    /* in extended mode, verify that each extension is expected type */
+    for_each_ext_boolean(j, tp) {
+       check_user_capability_type(ExtBoolname(tp, (int) j, strnames), BOOLEAN);
+    }
+    for_each_ext_number(j, tp) {
+       check_user_capability_type(ExtNumname(tp, (int) j, strnames), NUMBER);
+    }
+    for_each_ext_string(j, tp) {
+       check_user_capability_type(ExtStrname(tp, (int) j, strnames), STRING);
+    }
+#endif /* NCURSES_XNAMES */
 
     check_acs(tp);
     check_colors(tp);