=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man.c,v retrieving revision 1.135 retrieving revision 1.136 diff -c -r1.135 -r1.136 *** src/usr.bin/mandoc/man.c 2019/01/05 00:36:46 1.135 --- src/usr.bin/mandoc/man.c 2022/04/28 10:17:37 1.136 *************** *** 1,7 **** ! /* $OpenBSD: man.c,v 1.135 2019/01/05 00:36:46 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze * Copyright (c) 2011 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any --- 1,7 ---- ! /* $OpenBSD: man.c,v 1.136 2022/04/28 10:17:37 schwarze Exp $ */ /* + * Copyright (c) 2013-2015,2017-2019,2022 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any *************** *** 68,73 **** --- 68,76 ---- return (ep - cp) % 2 ? NULL : ep; } + /* + * Rewind all open next-line scopes. + */ void man_descope(struct roff_man *man, int line, int offs, char *start) { *************** *** 272,277 **** --- 275,284 ---- return 1; } + /* + * Rewind open next-line scopes + * unless the tok request or macro is allowed inside them. + */ void man_breakscope(struct roff_man *man, int tok) { *************** *** 292,301 **** (man_macro(n->tok)->flags & (MAN_NSCOPED | MAN_ESCOPED)) == MAN_NSCOPED) n = n->parent; ! ! mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, ! "%s breaks %s", roff_name[tok], roff_name[n->tok]); ! roff_node_delete(man, n); man->flags &= ~MAN_ELINE; } --- 299,313 ---- (man_macro(n->tok)->flags & (MAN_NSCOPED | MAN_ESCOPED)) == MAN_NSCOPED) n = n->parent; ! for (;;) { ! mandoc_msg(MANDOCERR_BLK_LINE, n->line, n->pos, ! "%s breaks %s", roff_name[tok], roff_name[n->tok]); ! if (n->parent->type != ROFFT_ELEM || ! (man_macro(n->parent->tok)->flags & ! MAN_ESCOPED) == 0) ! break; ! n = n->parent; ! } roff_node_delete(man, n); man->flags &= ~MAN_ELINE; }