=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.194 retrieving revision 1.197 diff -u -p -r1.194 -r1.197 --- mandoc/mdoc_macro.c 2015/04/21 16:14:25 1.194 +++ mandoc/mdoc_macro.c 2015/04/29 21:58:32 1.197 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.194 2015/04/21 16:14:25 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.197 2015/04/29 21:58:32 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze @@ -210,7 +210,7 @@ const struct mdoc_macro * const mdoc_macros = __mdoc_m * are errors. */ void -mdoc_macroend(struct roff_man *mdoc) +mdoc_endparse(struct roff_man *mdoc) { struct roff_node *n; @@ -644,6 +644,8 @@ blk_exp_close(MACRO_PROT_ARGS) if (body == NULL) { mandoc_msg(MANDOCERR_BLK_NOTOPEN, mdoc->parse, line, ppos, mdoc_macronames[tok]); + if (later != NULL) + later->flags &= ~MDOC_BROKEN; if (maxargs && endbody == NULL) { /* * Stray .Ec without previous .Eo: @@ -671,6 +673,8 @@ blk_exp_close(MACRO_PROT_ARGS) if (endbody != NULL) n = endbody; + + ntok = TOKEN_NONE; for (j = 0; ; j++) { lastarg = *pos; @@ -698,7 +702,7 @@ blk_exp_close(MACRO_PROT_ARGS) } if (n != NULL) { - if (n != mdoc->last && n->flags & MDOC_BROKEN) { + if (ntok != TOKEN_NONE && n->flags & MDOC_BROKEN) { target = n; do target = target->parent;