X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fcomp_parse.c;h=d45f2489a45667b140d72ddf8d752005a8150a43;hp=a1f9f4a877fb634cec5bc3a04fe48a9b97e7ce43;hb=55051e74621a33ee60ea8e38fe1e0a3e38a573ab;hpb=af4c589f0c605e1a1dd3825678a0b1a97df02d37 diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index a1f9f4a8..d45f2489 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2012 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 * @@ -47,7 +47,7 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.77 2011/10/01 22:43:51 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.85 2012/04/14 23:30:10 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -56,7 +56,7 @@ NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanit static void sanity_check(TERMTYPE *); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check; -static void fixup_acsc(TERMTYPE *, bool); +static void fixup_acsc(TERMTYPE *, int); static void enqueue(ENTRY * ep) @@ -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; @@ -470,7 +470,34 @@ _nc_resolve_uses2(bool fullresolve, bool literal) for_entry_list(qp) { _nc_curr_line = (int) qp->startline; _nc_set_type(_nc_first_name(qp->tterm.term_names)); - fixup_acsc(&qp->tterm, literal); + /* + * tic overrides this function pointer to provide more verbose + * 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); + } } DEBUG(2, ("SANITY CHECK FINISHED")); } @@ -495,7 +522,7 @@ _nc_resolve_uses(bool fullresolve) #define CUR tp-> static void -fixup_acsc(TERMTYPE *tp, bool literal) +fixup_acsc(TERMTYPE *tp, int literal) { if (!literal) { if (acs_chars == 0