#include <parametrized.h>
#include <transform.h>
-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 "<stdin>"
static const char *
parse_ti_delay(const char *ti, double *delays)
{
- int star = 0;
-
*delays = 0.0;
while (*ti != '\0') {
if (*ti == '\\') {
} else {
++ti;
}
- if (star)
- *delays = -(*delays);
}
return ti;
}
* 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;