=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man.c,v retrieving revision 1.45 retrieving revision 1.46 diff -c -r1.45 -r1.46 *** src/usr.bin/mandoc/man.c 2010/11/29 00:12:02 1.45 --- src/usr.bin/mandoc/man.c 2010/11/29 01:44:41 1.46 *************** *** 1,4 **** ! /* $Id: man.c,v 1.45 2010/11/29 00:12:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: man.c,v 1.46 2010/11/29 01:44:41 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * *************** *** 509,545 **** goto err; /* ! * Remove prior ELINE macro, as it's being clobbering by a new * macro. Note that NSCOPED macros do not close out ELINE * macros---they don't print text---so we let those slip by. */ if ( ! (MAN_NSCOPED & man_macros[tok].flags) && m->flags & MAN_ELINE) { - assert(MAN_TEXT != m->last->type); - - /* - * This occurs in the following construction: - * .B - * .br - * .B - * .br - * I hate man macros. - * Flat-out disallow this madness. - */ - if (MAN_NSCOPED & man_macros[m->last->tok].flags) { - man_pmsg(m, ln, ppos, MANDOCERR_SYNTLINESCOPE); - return(0); - } - n = m->last; ! assert(n); ! assert(NULL == n->child); ! assert(0 == n->nchild); ! if ( ! man_nmsg(m, n, MANDOCERR_LINESCOPE)) ! return(0); man_node_delete(m, n); m->flags &= ~MAN_ELINE; --- 509,530 ---- goto err; /* ! * Remove prior ELINE macro, as it's being clobbered by a new * macro. Note that NSCOPED macros do not close out ELINE * macros---they don't print text---so we let those slip by. */ if ( ! (MAN_NSCOPED & man_macros[tok].flags) && m->flags & MAN_ELINE) { n = m->last; + assert(MAN_TEXT != n->type); ! /* .B .br .br .B: remove prior including children */ ! if (MAN_NSCOPED & man_macros[n->tok].flags) ! n = n->parent; ! man_vmsg(m, MANDOCERR_LINESCOPE, n->line, n->pos, ! "%s", man_macronames[n->tok]); man_node_delete(m, n); m->flags &= ~MAN_ELINE;