aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitbbf2e5b44d2836d001e4dc02087421dbc5cb0c04 (patch)
treecf661847a4cd394702621bb6a017bdd106573c67 /man.c
parentceb333844fd9e76e1de9bcbdba748f57bc603591 (diff)
downloadmandoc-bbf2e5b44d2836d001e4dc02087421dbc5cb0c04.tar.gz
mandoc-bbf2e5b44d2836d001e4dc02087421dbc5cb0c04.tar.zst
mandoc-bbf2e5b44d2836d001e4dc02087421dbc5cb0c04.zip
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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/man.c b/man.c
index 191afdd5..f231f9b6 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.163 2015/04/23 16:17:44 schwarze Exp $ */
+/* $Id: man.c,v 1.164 2015/09/04 21:25:00 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -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.