diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-03-08 15:50:22 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-03-08 15:50:22 +0000 |
commit | 66f6cfa03b3b2ba7d54dff07150b9dce7e2777d0 (patch) | |
tree | 1fa1ee4fcf77dcc17eeaaeaac7197b2b0e6b4b76 /usr.bin/mandoc/tree.c | |
parent | 39a1b516887e24b84f5b5062e03f73d1deb81c89 (diff) |
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/tree.c')
-rw-r--r-- | usr.bin/mandoc/tree.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mandoc/tree.c b/usr.bin/mandoc/tree.c index ef4eed4ecd6..edbd2945d12 100644 --- a/usr.bin/mandoc/tree.c +++ b/usr.bin/mandoc/tree.c @@ -1,7 +1,7 @@ -/* $Id: tree.c,v 1.19 2013/12/24 19:10:34 schwarze Exp $ */ +/* $Id: tree.c,v 1.20 2014/03/08 15:50:21 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011 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 @@ -248,7 +248,10 @@ print_man(const struct man_node *n, int indent) } else { for (i = 0; i < indent; i++) putchar('\t'); - printf("%s (%s) %d:%d\n", p, t, n->line, n->pos); + printf("%s (%s) ", p, t); + if (MAN_LINE & n->flags) + putchar('*'); + printf("%d:%d\n", n->line, n->pos); } if (n->child) |