summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2010-02-26 12:42:29 +0000
committerschwarze <schwarze@openbsd.org>2010-02-26 12:42:29 +0000
commit82fd42190798914cf9341bc61b47a10613b2465a (patch)
tree5debbfb55180706f516f994c20cb9abdef7bbdfa /usr.bin/mandoc/man.c
parentSupport .It .Xo. (diff)
downloadwireguard-openbsd-82fd42190798914cf9341bc61b47a10613b2465a.tar.xz
wireguard-openbsd-82fd42190798914cf9341bc61b47a10613b2465a.zip
The groff_man(7) manual says "the first line of text following" .TP is
used as a label, not "the first line following", so allow (some kinds of) intervening macros - some people actually put macros in between. On the other hand, when there is no text line before the next block macro, that is, when the .TP block ends without any text line, then something *is* broken, so still error out in that case.
Diffstat (limited to 'usr.bin/mandoc/man.c')
-rw-r--r--usr.bin/mandoc/man.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index d9a88f7b648..daea772af0c 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.18 2010/02/18 02:11:26 schwarze Exp $ */
+/* $Id: man.c,v 1.19 2010/02/26 12:42:29 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -564,7 +564,8 @@ man_pmacro(struct man *m, int ln, char *buf)
goto err;
out:
- if ( ! (MAN_BLINE & fl))
+ if ( ! (MAN_BLINE & fl) || (MAN_TEXT != m->last->type &&
+ (NULL == m->last->child || MAN_TEXT != m->last->child->type)))
return(1);
/*