diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-08 15:50:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-08 15:50:41 +0000 |
commit | c3b19f4aeeab34b70784875fb9ac21067a5a5bc8 (patch) | |
tree | 6f798d47770eeb0f98527248c2c69e7434b4383f /man_html.c | |
parent | bdbb7d0355bd86cdd2bcaf08293edf32a911ebe5 (diff) | |
download | mandoc-c3b19f4aeeab34b70784875fb9ac21067a5a5bc8.tar.gz |
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 'man_html.c')
-rw-r--r-- | man_html.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,7 +1,7 @@ /* $Id$ */ /* * 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 @@ -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); } |