X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/2fa768dd3258ecc39730b020f47e705a97c74d79..c44d370823355882e5013556927675ea11fa8199:/man.c diff --git a/man.c b/man.c index a24c10d8..7a2bcc96 100644 --- a/man.c +++ b/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.175 2017/06/17 13:06:16 schwarze Exp $ */ +/* $Id: man.c,v 1.176 2017/06/28 12:52:45 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -282,8 +282,10 @@ man_breakscope(struct roff_man *man, int tok) if (man->flags & MAN_ELINE && (tok < MAN_TH || ! (man_macros[tok].flags & MAN_NSCOPED))) { n = man->last; - assert(n->type != ROFFT_TEXT); - if (man_macros[n->tok].flags & MAN_NSCOPED) + if (n->type == ROFFT_TEXT) + n = n->parent; + if (n->tok < MAN_TH || + man_macros[n->tok].flags & MAN_NSCOPED) n = n->parent; mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, @@ -319,7 +321,8 @@ man_breakscope(struct roff_man *man, int tok) n = man->last; if (n->type == ROFFT_TEXT) n = n->parent; - if ( ! (man_macros[n->tok].flags & MAN_BSCOPE)) + if (n->tok < MAN_TH || + (man_macros[n->tok].flags & MAN_BSCOPE) == 0) n = n->parent; assert(n->type == ROFFT_HEAD);