aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-08 20:33:53 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-08 20:33:53 +0000
commitb07175c583be6f4b4733c49a5e4e855490ea5191 (patch)
tree4ff2bc83f6fcc54d9e3b515b2374473490311cdb /roff.c
parentaa8151b1157e8486bce7cb08deeb4c78df1d9669 (diff)
downloadmandoc-b07175c583be6f4b4733c49a5e4e855490ea5191.tar.gz
mandoc-b07175c583be6f4b4733c49a5e4e855490ea5191.tar.zst
mandoc-b07175c583be6f4b4733c49a5e4e855490ea5191.zip
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 'roff.c')
-rw-r--r--roff.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index 8870d0c6..082eb556 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.301 2017/05/08 15:34:54 schwarze Exp $ */
+/* $Id: roff.c,v 1.302 2017/05/08 20:33:53 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -1009,7 +1009,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);
@@ -2778,6 +2778,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;
@@ -2826,6 +2830,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,