From f1b5aca91094613ffed617cc1e1643ddb36cb81f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 8 May 2017 20:33:41 +0000 Subject: 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. --- usr.bin/mandoc/roff.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.bin/mandoc/roff.c') 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 * Copyright (c) 2010-2015, 2017 Ingo Schwarze @@ -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, -- cgit v1.2.3