=================================================================== RCS file: /cvs/mandoc/man.c,v retrieving revision 1.113 retrieving revision 1.118 diff -u -p -r1.113 -r1.118 --- mandoc/man.c 2011/11/07 01:24:40 1.113 +++ mandoc/man.c 2012/07/14 10:47:07 1.118 @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.113 2011/11/07 01:24:40 schwarze Exp $ */ +/* $Id: man.c,v 1.118 2012/07/14 10:47:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * @@ -40,7 +40,7 @@ const char *const __man_macronames[MAN_MAX] = { "RI", "na", "sp", "nf", "fi", "RE", "RS", "DT", "UC", "PD", "AT", "in", - "ft" + "ft", "OP", "EX", "EE" }; const char * const *man_macronames = __man_macronames; @@ -131,7 +131,7 @@ man_parseln(struct man *m, int ln, char *buf, int offs assert( ! (MAN_HALT & m->flags)); - return (mandoc_getcontrol(buf, &offs) ? + return (roff_getcontrol(m->roff, buf, &offs) ? man_pmacro(m, ln, buf, offs) : man_ptext(m, ln, buf, offs)); } @@ -435,9 +435,10 @@ man_ptext(struct man *m, int line, char *buf, int offs if ('\0' == buf[i]) { /* Allocate a blank entry. */ - if ( ! man_word_alloc(m, line, offs, "")) + if ( ! man_elem_alloc(m, line, offs, MAN_sp)) return(0); - return(man_descope(m, line, offs)); + m->next = MAN_NEXT_SIBLING; + return(1); } /* @@ -556,10 +557,15 @@ man_pmacro(struct man *m, int ln, char *buf, int offs) if ((m->flags & MAN_BLINE) && (MAN_BSCOPE & man_macros[tok].flags)) { n = m->last; - assert(MAN_TEXT != n->type); - /* Remove element that didn't end BLINE, if any. */ + /* Might be a text node like 8 in + * .TP 8 + * .SH foo + */ + if (MAN_TEXT == n->type) + n = n->parent; + /* Remove element that didn't end BLINE, if any. */ if ( ! (MAN_BSCOPE & man_macros[n->tok].flags)) n = n->parent;