summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@netbsd.org>2011-11-16 22:39:05 +0000
committerJoerg Sonnenberger <joerg@netbsd.org>2011-11-16 22:39:05 +0000
commit6d7a9718d074e6db5996372ac36f9b50ac1f3231 (patch)
tree433eaa4a3adc3f81ff3e50a684545b7c7ff12311 /man.c
parentb087b6ad35086c52dd2cd371aa56b1a566734498 (diff)
downloadmandoc-6d7a9718d074e6db5996372ac36f9b50ac1f3231.tar.gz
Correctly handle constructs like
.TP 8 .SH foo
Diffstat (limited to 'man.c')
-rw-r--r--man.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/man.c b/man.c
index f7c70d75..170441b0 100644
--- a/man.c
+++ b/man.c
@@ -556,10 +556,15 @@ man_pmacro(struct man *m, int ln, char *buf, int offs)
if ((m->flags & MAN_BLINE) &&
(MAN_BSCOPE & man_macros[tok].flags)) {
n = m->last;
- assert(MAN_TEXT != n->type);
- /* Remove element that didn't end BLINE, if any. */
+ /* Might be a text node like 8 in
+ * .TP 8
+ * .SH foo
+ */
+ if (MAN_TEXT == n->type)
+ n = n->parent;
+ /* Remove element that didn't end BLINE, if any. */
if ( ! (MAN_BSCOPE & man_macros[n->tok].flags))
n = n->parent;