X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Fdump_entry.c;h=860eccc9a37736df6d1aefd2354558af33d528ed;hp=acafaf76c076499ac05637b1e636d1a3e02d9565;hb=deb0d07e8eb4803b9e9653359eab17a30d04369d;hpb=d30f99439fcc8d4bb4c38e5c4afb4f6555fc6ad4 diff --git a/progs/dump_entry.c b/progs/dump_entry.c index acafaf76..860eccc9 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -36,11 +36,11 @@ #define __INTERNAL_CAPS_VISIBLE #include -#include "dump_entry.h" -#include "termsort.c" /* this C file is generated */ +#include +#include /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.184 2021/04/03 23:01:08 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.189 2021/09/04 10:29:59 tom Exp $") #define DISCARD(string) string = ABSENT_STRING #define PRINTF (void) printf @@ -85,7 +85,7 @@ static int indent = 8; /* cover various ports and variants of terminfo */ #define V_ALLCAPS 0 /* all capabilities (SVr4, XSI, ncurses) */ #define V_SVR1 1 /* SVR1, Ultrix */ -#define V_HPUX 2 /* HP/UX */ +#define V_HPUX 2 /* HP-UX */ #define V_AIX 3 /* AIX */ #define V_BSD 4 /* BSD */ @@ -549,7 +549,7 @@ fill_spaces(const char *src) if (pass) { result[d] = '\0'; } else { - result = malloc(need + 1); + result = calloc(need + 1, sizeof(char)); if (result == 0) failed("fill_spaces"); } @@ -915,7 +915,6 @@ fmt_entry(TERMTYPE2 *tterm, { PredIdx i, j; char buffer[MAX_TERMINFO_LENGTH + EXTRA_CAP]; - char *capability; NCURSES_CONST char *name; int predval, len; PredIdx num_bools = 0; @@ -1035,6 +1034,7 @@ fmt_entry(TERMTYPE2 *tterm, } for_each_string(j, tterm) { + char *capability; i = StrIndirect(j); name = ExtStrname(tterm, (int) i, str_names); assert(strlen(name) < sizeof(buffer) - EXTRA_CAP); @@ -1483,7 +1483,7 @@ dump_entry(TERMTYPE2 *tterm, PredFunc pred) { TERMTYPE2 save_tterm; - int len, critlen; + int critlen; const char *legend; bool infodump; @@ -1564,7 +1564,7 @@ dump_entry(TERMTYPE2 *tterm, } if (FMT_ENTRY() > critlen) { /* - * We pick on sgr because it's a nice long string capability that + * We pick on sgr because it is a nice long string capability that * is really just an optimization hack. Another good candidate is * acsc since it is both long and unused by BSD termcap. */ @@ -1609,6 +1609,7 @@ dump_entry(TERMTYPE2 *tterm, } if (!changed || (FMT_ENTRY() > critlen)) { int oldversion = tversion; + int len; tversion = V_BSD; SHOW_WHY("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n",