X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fcomp_parse.c;h=6e516011bfc8b0d097cd826285b4a77c69c63791;hp=48bd97a8923cd9c1d1d347ac2aa8adba3415dd2b;hb=4ceb04b5e19df8964f98c7675d9448c205a2053e;hpb=01433b4eede468929bccc74b22324cb44540e990 diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 48bd97a8..6e516011 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.79 2012/01/28 21:49:23 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.86 2012/10/27 21:48:03 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -83,7 +83,7 @@ force_bar(char *dst, char *src) if (len > MAX_NAME_SIZE) len = MAX_NAME_SIZE; (void) strncpy(dst, src, len); - (void) strcpy(dst + len, "|"); + _nc_STRCPY(dst + len, "|", MAX_NAME_SIZE); src = dst; } return src; @@ -348,9 +348,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) DEBUG(2, ("%s: resolving use=%s (compiled)", child, lookfor)); - rp = typeMalloc(ENTRY, 1); - if (rp == 0) - _nc_err_abort(MSG_NO_MEMORY); + TYPE_MALLOC(ENTRY, 1, rp); rp->tterm = thisterm; rp->nuses = 0; rp->next = lastread; @@ -475,7 +473,26 @@ _nc_resolve_uses2(bool fullresolve, bool literal) * checking. */ if (_nc_check_termtype2 != sanity_check2) { + SCREEN *save_SP = SP; + SCREEN fake_sp; + TERMINAL fake_tm; + TERMINAL *save_tm = cur_term; + + /* + * Setup so that tic can use ordinary terminfo interface + * to obtain capability information. + */ + memset(&fake_sp, 0, sizeof(fake_sp)); + memset(&fake_tm, 0, sizeof(fake_tm)); + fake_sp._term = &fake_tm; + fake_tm.type = qp->tterm; + SP = &fake_sp; + set_curterm(&fake_tm); + _nc_check_termtype2(&qp->tterm, literal); + + SP = save_SP; + set_curterm(save_tm); } else { fixup_acsc(&qp->tterm, literal); }