summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-03-08 15:50:21 +0000
committerschwarze <schwarze@openbsd.org>2014-03-08 15:50:21 +0000
commit074125cb1f6a055b6cfbce4973cf56d06778aa1d (patch)
tree70800910adde201f369a7cce9d59c9b3883afb15 /usr.bin/mandoc/man_html.c
parentcode cleanup (diff)
downloadwireguard-openbsd-074125cb1f6a055b6cfbce4973cf56d06778aa1d.tar.xz
wireguard-openbsd-074125cb1f6a055b6cfbce4973cf56d06778aa1d.zip
To find out whether .TP head arguments are same-line or next-line arguments,
use the MAN_LINE flag instead of the man_node line member. This is required such that user-defined macros wrapping .TP work correctly. Issue found by Havard Eidnes in Tcl_NewStringObj(3), reported via the NetBSD bug tracking system and Thomas Klausner <wiz at NetBSD>.
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index 3d897fea064..f78447dafa4 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,7 +1,7 @@
-/* $Id: man_html.c,v 1.49 2013/10/17 20:51:29 schwarze Exp $ */
+/* $Id: man_html.c,v 1.50 2014/03/08 15:50:21 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -549,10 +549,15 @@ man_IP_pre(MAN_ARGS)
/* For TP, only print next-line header elements. */
- if (MAN_TP == n->tok)
- for (nn = n->child; nn; nn = nn->next)
- if (nn->line > n->line)
- print_man_node(man, nn, mh, h);
+ if (MAN_TP == n->tok) {
+ nn = n->child;
+ while (NULL != nn && 0 == (MAN_LINE & nn->flags))
+ nn = nn->next;
+ while (NULL != nn) {
+ print_man_node(man, nn, mh, h);
+ nn = nn->next;
+ }
+ }
return(0);
}