summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-03 15:55:24 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-03 15:55:24 +0000
commit90897efbceb54855c1943f8e19d5bba5a542ff65 (patch)
treee2c70156dcf82c5d21e24e9dda0d94d0cb1a26f2 /man.c
parent3248b177a4b5624bb57796f898b81736244d2579 (diff)
downloadmandoc-90897efbceb54855c1943f8e19d5bba5a542ff65.tar.gz
ignore blank lines in man(7) next line scope;
strange groff edge case behaviour found in multimedia/mjpegtools
Diffstat (limited to 'man.c')
-rw-r--r--man.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/man.c b/man.c
index 68d1fee1..971b15bf 100644
--- a/man.c
+++ b/man.c
@@ -89,14 +89,15 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs)
/* Skip leading whitespace. */ ;
/*
- * Blank lines are ignored right after headings
- * but add a single vertical space elsewhere.
+ * Blank lines are ignored in next line scope and right
+ * after headings but add a single vertical space elsewhere.
*/
if (buf[i] == '\0') {
- man_breakscope(man, ROFF_sp);
- /* Allocate a blank entry. */
- if (man->last->tok != MAN_SH &&
+ if (man->flags & (MAN_ELINE | MAN_BLINE))
+ mandoc_msg(MANDOCERR_BLK_BLANK, man->parse,
+ line, 0, NULL);
+ else if (man->last->tok != MAN_SH &&
man->last->tok != MAN_SS) {
roff_elem_alloc(man, line, offs, ROFF_sp);
man->next = ROFF_NEXT_SIBLING;