From 49fc5b876caef96271d1484f9279fd423d9b04ff Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 8 Mar 2014 15:50:41 +0000 Subject: 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 . --- man_html.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'man_html.c') diff --git a/man_html.c b/man_html.c index 2c4e220a..4deb1cb3 100644 --- a/man_html.c +++ b/man_html.c @@ -1,7 +1,7 @@ -/* $Id: man_html.c,v 1.90 2013/10/17 20:54:58 schwarze Exp $ */ +/* $Id: man_html.c,v 1.91 2014/03/08 15:50:41 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons - * Copyright (c) 2013 Ingo Schwarze + * Copyright (c) 2013, 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -553,10 +553,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); } -- cgit v1.2.3-56-ge451