diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-02-26 12:42:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2010-02-26 12:42:30 +0000 |
commit | dcfdceaac423336925dcee2964a192807bfce5f5 (patch) | |
tree | 0390477b4f74ac4ea72dbcffbfdd68e55435f3df /usr.bin/mandoc/man_term.c | |
parent | edd55148017e5ed1479d7bc9d62502478202b158 (diff) |
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_term.c')
-rw-r--r-- | usr.bin/mandoc/man_term.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 50f175e752c..87c1c7bb723 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.21 2009/12/24 02:08:14 schwarze Exp $ */ +/* $Id: man_term.c,v 1.22 2010/02/26 12:42:29 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -570,10 +570,13 @@ pre_TP(DECL_ARGS) /* Calculate offset. */ - if (NULL != (nn = n->parent->head->child)) - if (NULL != nn->next) + if (NULL != (nn = n->parent->head->child)) { + while (nn && MAN_TEXT != nn->type) + nn = nn->next; + if (nn && nn->next) if ((ival = a2width(nn)) >= 0) len = (size_t)ival; + } switch (n->type) { case (MAN_HEAD): |