X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Fdump_entry.c;h=0f6a8b05bab399521c8033541c3bb0f67aab74d5;hp=65de9f9bc1f10f9c648e1341075789a0c81a824b;hb=6434e809cb70f93cc76d0f833e74447e32c99f54;hpb=83e9a85c4205c920cc9992bfc96f6546cd4fff22 diff --git a/progs/dump_entry.c b/progs/dump_entry.c index 65de9f9b..0f6a8b05 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 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 * @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.111 2013/12/15 01:05:20 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.114 2014/10/18 09:32:54 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -470,7 +470,7 @@ indent_DYN(DYNBUF * buffer, int level) strncpy_DYN(buffer, "\t", (size_t) 1); } -static bool +bool has_params(const char *src) { bool result = FALSE; @@ -791,10 +791,13 @@ fmt_entry(TERMTYPE *tterm, "%s@", name); WRAP_CONCAT; } else if (outform == F_TERMCAP || outform == F_TCONVERR) { - int params = ((i < (int) SIZEOF(parametrized)) - ? parametrized[i] - : 0); char *srccap = _nc_tic_expand(capability, TRUE, numbers); + int params = (((i < (int) SIZEOF(parametrized)) && + (i < STRCOUNT)) + ? parametrized[i] + : ((*srccap == 'k') + ? 0 + : has_params(srccap))); char *cv = _nc_infotocap(name, srccap, params); if (cv == 0) {