diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-05-08 20:33:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-05-08 20:33:41 +0000 |
commit | f1b5aca91094613ffed617cc1e1643ddb36cb81f (patch) | |
tree | ba4bf14278fada9372fbe4d9d7ab992e6a7d6122 /usr.bin/mandoc/roff.c | |
parent | 1d7e974d90ad6036a86b784ba57132df9a6c90f7 (diff) |
Line-breaking roff(7) requests also break man(7) next-line scope.
Considering that real roff implements next-line scope using input
line traps, that isn't all that surprising.
Issue found in the games/xbattle port.
Diffstat (limited to 'usr.bin/mandoc/roff.c')
-rw-r--r-- | usr.bin/mandoc/roff.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index f2395296b30..9893599c0eb 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: roff.c,v 1.173 2017/05/08 15:33:43 schwarze Exp $ */ +/* $OpenBSD: roff.c,v 1.174 2017/05/08 20:33:40 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -1007,7 +1007,7 @@ roff_addtbl(struct roff_man *man, const struct tbl_span *tbl) struct roff_node *n; if (man->macroset == MACROSET_MAN) - man_breakscope(man, TOKEN_NONE); + man_breakscope(man, ROFF_TS); n = roff_node_alloc(man, tbl->line, 0, ROFFT_TBL, TOKEN_NONE); n->span = tbl; roff_node_append(man, n); @@ -2776,6 +2776,10 @@ roff_onearg(ROFF_ARGS) struct roff_node *n; char *cp; + if (r->man->flags & (MAN_BLINE | MAN_ELINE) && + (tok == ROFF_sp || tok == ROFF_ti)) + man_breakscope(r->man, tok); + roff_elem_alloc(r->man, ln, ppos, tok); n = r->man->last; @@ -2824,6 +2828,8 @@ roff_manyarg(ROFF_ARGS) static enum rofferr roff_br(ROFF_ARGS) { + if (r->man->flags & (MAN_BLINE | MAN_ELINE)) + man_breakscope(r->man, ROFF_br); roff_elem_alloc(r->man, ln, ppos, ROFF_br); if (buf->buf[pos] != '\0') mandoc_vmsg(MANDOCERR_ARG_SKIP, r->parse, ln, pos, |