summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-09-04 21:25:00 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-09-04 21:25:00 +0000
commit41352abb31bca3448fdf6a656c79fb4986624085 (patch)
treec5be5c34a1ae5085a012f5b17c63af239cdd6def /man.c
parent1bca1b26aa408603e89d1a896729319ba8f93084 (diff)
downloadmandoc-41352abb31bca3448fdf6a656c79fb4986624085.tar.gz
Fill mode changes don't break next-line scope in all cases,
in particular not for tagged paragraphs. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the exiv2(1) manual page.
Diffstat (limited to 'man.c')
-rw-r--r--man.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/man.c b/man.c
index c0d245da..874787d9 100644
--- a/man.c
+++ b/man.c
@@ -283,6 +283,20 @@ man_breakscope(struct roff_man *man, int tok)
}
/*
+ * Weird special case:
+ * Switching fill mode closes section headers.
+ */
+
+ if (man->flags & MAN_BLINE &&
+ (tok == MAN_nf || tok == MAN_fi) &&
+ (man->last->tok == MAN_SH || man->last->tok == MAN_SS)) {
+ n = man->last;
+ man_unscope(man, n);
+ roff_body_alloc(man, n->line, n->pos, n->tok);
+ man->flags &= ~MAN_BLINE;
+ }
+
+ /*
* A block header next line scope is open,
* and the new macro is not allowed inside block headers.
* Delete the block that is being broken.