=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_man.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- src/usr.bin/mandoc/mdoc_man.c 2015/02/11 14:14:53 1.84 +++ src/usr.bin/mandoc/mdoc_man.c 2015/02/12 12:20:47 1.85 @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_man.c,v 1.84 2015/02/11 14:14:53 schwarze Exp $ */ +/* $OpenBSD: mdoc_man.c,v 1.85 2015/02/12 12:20:47 schwarze Exp $ */ /* * Copyright (c) 2011-2015 Ingo Schwarze * @@ -27,8 +27,7 @@ #include "mdoc.h" #include "main.h" -#define DECL_ARGS const struct mdoc_meta *meta, \ - const struct mdoc_node *n +#define DECL_ARGS const struct mdoc_meta *meta, struct mdoc_node *n struct manact { int (*cond)(DECL_ARGS); /* DON'T run actions */ @@ -546,10 +545,10 @@ man_mdoc(void *arg, const struct mdoc *mdoc) { const struct mdoc_meta *meta; - const struct mdoc_node *n; + struct mdoc_node *n; meta = mdoc_meta(mdoc); - n = mdoc_node(mdoc); + n = mdoc_node(mdoc)->child; printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", meta->title, @@ -565,15 +564,18 @@ fontqueue.head = fontqueue.tail = mandoc_malloc(8); *fontqueue.tail = 'R'; } - print_node(meta, n); + while (n != NULL) { + print_node(meta, n); + n = n->next; + } putchar('\n'); } static void print_node(DECL_ARGS) { - const struct mdoc_node *sub; const struct manact *act; + struct mdoc_node *sub; int cond, do_sub; /* @@ -586,6 +588,7 @@ act = NULL; cond = 0; do_sub = 1; + n->flags &= ~MDOC_ENDED; if (MDOC_TEXT == n->type) { /* @@ -633,7 +636,7 @@ (*act->post)(meta, n); if (ENDBODY_NOT != n->end) - n->pending->flags |= MDOC_ENDED; + n->body->flags |= MDOC_ENDED; if (ENDBODY_NOSPACE == n->end) outflags &= ~(MMAN_spc | MMAN_nl);