X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=progs%2Finfocmp.c;h=d52d05a679f748ba24e374c91f8f398805badfde;hb=3ee7a3a610ec0b332bf1fd62503327b249a44c73;hp=449270efa96f16e092ac042a1adcf6f1f0a35c82;hpb=4e793faf6575b2297482f77b2bc3d18105c0fc76;p=ncurses.git diff --git a/progs/infocmp.c b/progs/infocmp.c index 449270ef..d52d05a6 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.125 2013/05/25 20:13:24 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.128 2013/12/15 01:06:52 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'; @@ -813,7 +818,7 @@ analyze_string(const char *name, const char *cap, TERMTYPE *tp) if (_nc_capcmp(cp, buf2)) continue; -#define ISRS(s) (!strncmp((s), "is", 2) || !strncmp((s), "rs", 2)) +#define ISRS(s) (!strncmp((s), "is", (size_t) 2) || !strncmp((s), "rs", (size_t) 2)) /* * Theoretically we just passed the test for translation * (equality once the padding is stripped). However, there