X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftic.c;h=763c2b790a0e9cac6fc4524275a0657d7084b26c;hp=2781bae760b13c3a219e99d43d0096655a09ef25;hb=5865ab4cec503465a610827c43b4b11b36fcda79;hpb=34d602f272c394e9a980438e636e1ce4d355f83b diff --git a/progs/tic.c b/progs/tic.c index 2781bae7..763c2b79 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.204 2014/05/24 15:47:40 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.208 2014/10/18 09:34:29 tom Exp $") #define STDIN_NAME "" @@ -1809,8 +1809,6 @@ parse_delay_value(const char *src, double *delays, int *always) static const char * parse_ti_delay(const char *ti, double *delays) { - int star = 0; - *delays = 0.0; while (*ti != '\0') { if (*ti == '\\') { @@ -1827,8 +1825,6 @@ parse_ti_delay(const char *ti, double *delays) } else { ++ti; } - if (star) - *delays = -(*delays); } return ti; } @@ -1895,20 +1891,23 @@ same_ti_tc(const char *ti, const char *tc, bool * embedded) * Check terminfo to termcap translation. */ static void -check_infotocap(TERMTYPE *tp, int i, char *value) +check_infotocap(TERMTYPE *tp, int i, const char *value) { const char *name = ExtStrname(tp, i, strnames); - int params = ((i < (int) SIZEOF(parametrized)) + int params = (((i < (int) SIZEOF(parametrized)) && + (i < STRCOUNT)) ? parametrized[i] - : 0); + : ((*value == 'k') + ? 0 + : has_params(value))); int to_char = 0; - char *ti_value = _nc_tic_expand(value, TRUE, to_char); - char *tc_value = _nc_infotocap(name, ti_value, params); + char *ti_value; + char *tc_value; bool embedded; - if (ti_value == ABSENT_STRING) { + if ((ti_value = _nc_tic_expand(value, TRUE, to_char)) == ABSENT_STRING) { _nc_warning("tic-expansion of %s failed", name); - } else if (tc_value == ABSENT_STRING) { + } else if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) { _nc_warning("tic-conversion of %s failed", name); } else if (params > 0) { int limit = 5;