]> git.cameronkatri.com Git - mandoc.git/blobdiff - tree.c
To better support MLINKS, we will have to split the "docs" database
[mandoc.git] / tree.c
diff --git a/tree.c b/tree.c
index 9e7e7590c4a3ec2fc7892d394a21811d9b31fd96..fdb70e1b9338cec63ad223d6ff5a396242683efb 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -1,6 +1,7 @@
-/*     $Id: tree.c,v 1.46 2011/07/23 12:01:54 kristaps Exp $ */
+/*     $Id: tree.c,v 1.50 2013/12/24 19:11:46 schwarze Exp $ */
 /*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
+ * 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)