Print this page
5051 import mdocml-1.12.3
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: TBD

*** 1,8 **** ! /* $Id: tree.c,v 1.47 2011/09/18 14:14:15 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * --- 1,9 ---- ! /* $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 * copyright notice and this permission notice appear in all copies. *
*** 56,72 **** static void print_mdoc(const struct mdoc_node *n, int indent) { const char *p, *t; int i, j; ! size_t argc, sz; ! char **params; struct mdoc_argv *argv; argv = NULL; ! argc = sz = 0; ! params = NULL; t = p = NULL; switch (n->type) { case (MDOC_ROOT): t = "root"; --- 57,71 ---- static void print_mdoc(const struct mdoc_node *n, int indent) { const char *p, *t; int i, j; ! size_t argc; struct mdoc_argv *argv; argv = NULL; ! argc = 0; t = p = NULL; switch (n->type) { case (MDOC_ROOT): t = "root";
*** 160,173 **** printf(" [%s]", argv[i].value[j]); 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); } if (n->child) print_mdoc(n->child, indent + 1); if (n->next) --- 159,175 ---- printf(" [%s]", argv[i].value[j]); if (argv[i].sz > 0) printf(" ]"); } ! 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) print_mdoc(n->child, indent + 1); if (n->next)