diff options
author | Garrett D'Amore <garrett@damore.org> | 2014-07-25 14:50:37 -0700 |
---|---|---|
committer | Garrett D'Amore <garrett@damore.org> | 2014-08-02 00:19:34 -0700 |
commit | 698f87a48e2e945bfe5493ce168e0d0ae1cedd5c (patch) | |
tree | 385784d73d5e580be0ffca40abad0dabf0e6084d /usr/src/cmd/mandoc/tree.c | |
parent | 7f18da4c54210b682e105b0e7be5195c60f98d20 (diff) | |
download | illumos-gate-698f87a48e2e945bfe5493ce168e0d0ae1cedd5c.tar.gz |
5051 import mdocml-1.12.3
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Rich Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/cmd/mandoc/tree.c')
-rw-r--r-- | usr/src/cmd/mandoc/tree.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/usr/src/cmd/mandoc/tree.c b/usr/src/cmd/mandoc/tree.c index 1430c737e0..fdb70e1b93 100644 --- a/usr/src/cmd/mandoc/tree.c +++ b/usr/src/cmd/mandoc/tree.c @@ -1,6 +1,7 @@ -/* $Id: tree.c,v 1.47 2011/09/18 14:14:15 schwarze Exp $ */ +/* $Id: tree.c,v 1.50 2013/12/24 19:11:46 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> + * Copyright (c) 2013 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 @@ -58,13 +59,11 @@ print_mdoc(const struct mdoc_node *n, int indent) { const char *p, *t; int i, j; - size_t argc, sz; - char **params; + size_t argc; struct mdoc_argv *argv; argv = NULL; - argc = sz = 0; - params = NULL; + argc = 0; t = p = NULL; switch (n->type) { @@ -161,11 +160,14 @@ print_mdoc(const struct mdoc_node *n, int indent) if (argv[i].sz > 0) printf(" ]"); } - - for (i = 0; i < (int)sz; i++) - printf(" [%s]", params[i]); - printf(" %d:%d\n", n->line, n->pos); + putchar(' '); + if (MDOC_LINE & n->flags) + putchar('*'); + printf("%d:%d", n->line, n->pos); + if (n->lastline != n->line) + printf("-%d", n->lastline); + putchar('\n'); } if (n->child) |