]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/infocmp.c
ncurses 5.9 - patch 20131116
[ncurses.git] / progs / infocmp.c
index e58d691ece2a674d9a37caa47a2aaaf6ed6bf3a2..fc57c15502f6a9ed080882dc8b69e987de7c3828 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.124 2013/04/13 22:15:14 Miroslav.Lichvar Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.127 2013/11/16 20:26:09 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -404,7 +404,11 @@ show_comparing(char **names)
  * macro is used for limit-checks against the symbols that tic uses to omit
  * the two types of non-standard entry.
  */
+#if NCURSES_XNAMES
 #define check_user_definable(n,limit) if (!_nc_user_definable && (n) > (limit)) break
+#else
+#define check_user_definable(n,limit) if ((n) > (limit)) break
+#endif
 
 /*
  * Use these macros to simplify loops on C_COMMON and C_NAND:
@@ -784,7 +788,7 @@ analyze_string(const char *name, const char *cap, TERMTYPE *tp)
     const assoc *ap;
     int tp_lines = tp->Numbers[2];
 
-    if (cap == ABSENT_STRING || cap == CANCELLED_STRING)
+    if (!VALID_STRING(cap))
        return;
     (void) printf("%s: ", name);
 
@@ -800,12 +804,13 @@ analyze_string(const char *name, const char *cap, TERMTYPE *tp)
        for (i = 0; i < STRCOUNT; i++) {
            char *cp = tp->Strings[i];
 
-           /* don't use soft-key capabilities */
-           if (strnames[i][0] == 'k' && strnames[i][0] == 'f')
+           /* don't use function-key capabilities */
+           if (strnames[i][0] == 'k' && strnames[i][1] == 'f')
                continue;
 
-           if (cp != ABSENT_STRING && cp != CANCELLED_STRING && cp[0] && cp
-               != cap) {
+           if (VALID_STRING(cp) &&
+               cp[0] != '\0' &&
+               cp != cap) {
                len = strlen(cp);
                (void) strncpy(buf2, sp, len);
                buf2[len] = '\0';
@@ -1745,7 +1750,7 @@ main(int argc, char *argv[])
            tname[termcount] = argv[optind];
 
            if (directory) {
-#if USE_DATABASE
+#if NCURSES_USE_DATABASE
 #if MIXEDCASE_FILENAMES
 #define LEAF_FMT "%c"
 #else