summaryrefslogtreecommitdiffstats
path: root/man.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
commit73dc5e8b721bdd4c7e867dc7dd39d4f8dec3e3a9 (patch)
treeb24d5c6f8df8f4b598ba7e51d302c78191c54fc4 /man.c
parent743d8976911a7ef031de0fe12ef9ba67c3e7e5d4 (diff)
downloadmandoc-73dc5e8b721bdd4c7e867dc7dd39d4f8dec3e3a9.tar.gz
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 'man.c')
-rw-r--r--man.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/man.c b/man.c
index 98e259e5..68d1fee1 100644
--- a/man.c
+++ b/man.c
@@ -94,6 +94,7 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs)
*/
if (buf[i] == '\0') {
+ man_breakscope(man, ROFF_sp);
/* Allocate a blank entry. */
if (man->last->tok != MAN_SH &&
man->last->tok != MAN_SS) {
@@ -258,7 +259,7 @@ man_breakscope(struct roff_man *man, int tok)
* Delete the element that is being broken.
*/
- if (man->flags & MAN_ELINE && (tok == TOKEN_NONE ||
+ if (man->flags & MAN_ELINE && (tok < MAN_TH ||
! (man_macros[tok].flags & MAN_NSCOPED))) {
n = man->last;
assert(n->type != ROFFT_TEXT);
@@ -267,8 +268,7 @@ man_breakscope(struct roff_man *man, int tok)
mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
n->line, n->pos, "%s breaks %s",
- tok == TOKEN_NONE ? "TS" : roff_name[tok],
- roff_name[n->tok]);
+ roff_name[tok], roff_name[n->tok]);
roff_node_delete(man, n);
man->flags &= ~MAN_ELINE;
@@ -294,7 +294,7 @@ man_breakscope(struct roff_man *man, int tok)
* Delete the block that is being broken.
*/
- if (man->flags & MAN_BLINE && (tok == TOKEN_NONE ||
+ if (man->flags & MAN_BLINE && (tok < MAN_TH ||
man_macros[tok].flags & MAN_BSCOPE)) {
n = man->last;
if (n->type == ROFFT_TEXT)
@@ -309,8 +309,7 @@ man_breakscope(struct roff_man *man, int tok)
mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse,
n->line, n->pos, "%s breaks %s",
- tok == TOKEN_NONE ? "TS" : roff_name[tok],
- roff_name[n->tok]);
+ roff_name[tok], roff_name[n->tok]);
roff_node_delete(man, n);
man->flags &= ~MAN_BLINE;