=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.202 retrieving revision 1.203 diff -c -r1.202 -r1.203 *** src/usr.bin/mandoc/mdoc_validate.c 2015/04/18 16:04:40 1.202 --- src/usr.bin/mandoc/mdoc_validate.c 2015/04/19 13:50:10 1.203 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_validate.c,v 1.202 2015/04/18 16:04:40 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_validate.c,v 1.203 2015/04/19 13:50:10 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze *************** *** 34,39 **** --- 34,40 ---- #include "roff.h" #include "mdoc.h" #include "libmandoc.h" + #include "roff_int.h" #include "libmdoc.h" /* FIXME: .Bl -diag can't have non-text children in HEAD. */ *************** *** 895,901 **** n->child->next->line, n->child->next->pos, "Fo ... %s", n->child->next->string); while (n->child != n->last) ! mdoc_node_delete(mdoc, n->last); } post_fname(mdoc); --- 896,902 ---- n->child->next->line, n->child->next->pos, "Fo ... %s", n->child->next->string); while (n->child != n->last) ! roff_node_delete(mdoc, n->last); } post_fname(mdoc); *************** *** 1237,1243 **** mdoc->parse, nc->line, nc->pos, "%s before It", mdoc_macronames[nc->tok]); ! mdoc_node_delete(mdoc, nc); } else break; nc = ni->body->last; --- 1238,1244 ---- mdoc->parse, nc->line, nc->pos, "%s before It", mdoc_macronames[nc->tok]); ! roff_node_delete(mdoc, nc); } else break; nc = ni->body->last; *************** *** 1348,1354 **** mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, nch->line, nch->pos, "Bl ... %s", nch->string); while (nch != NULL) { ! mdoc_node_delete(mdoc, nch); nch = nh->child; } return; --- 1349,1355 ---- mandoc_vmsg(MANDOCERR_ARG_EXCESS, mdoc->parse, nch->line, nch->pos, "Bl ... %s", nch->string); while (nch != NULL) { ! roff_node_delete(mdoc, nch); nch = nh->child; } return; *************** *** 1389,1395 **** argv->value[i++] = nch->string; nch->string = NULL; nnext = nch->next; ! mdoc_node_delete(NULL, nch); } nh->nchild = 0; nh->child = NULL; --- 1390,1396 ---- argv->value[i++] = nch->string; nch->string = NULL; nnext = nch->next; ! roff_node_delete(NULL, nch); } nh->nchild = 0; nh->child = NULL; *************** *** 1488,1494 **** if (n->type == ROFFT_BLOCK && n->body->child == NULL) { mandoc_msg(MANDOCERR_BLK_EMPTY, mdoc->parse, n->line, n->pos, "Bk"); ! mdoc_node_delete(mdoc, n); } } --- 1489,1495 ---- if (n->type == ROFFT_BLOCK && n->body->child == NULL) { mandoc_msg(MANDOCERR_BLK_EMPTY, mdoc->parse, n->line, n->pos, "Bk"); ! roff_node_delete(mdoc, n); } } *************** *** 1576,1582 **** if (NULL == (p = mdoc_a2st(nch->string))) { mandoc_vmsg(MANDOCERR_ST_BAD, mdoc->parse, nch->line, nch->pos, "St %s", nch->string); ! mdoc_node_delete(mdoc, n); } else { free(nch->string); nch->string = mandoc_strdup(p); --- 1577,1583 ---- if (NULL == (p = mdoc_a2st(nch->string))) { mandoc_vmsg(MANDOCERR_ST_BAD, mdoc->parse, nch->line, nch->pos, "St %s", nch->string); ! roff_node_delete(mdoc, n); } else { free(nch->string); nch->string = mandoc_strdup(p); *************** *** 1623,1629 **** /* * Remove this child from the chain. This somewhat ! * repeats mdoc_node_unlink(), but since we're * just re-ordering, there's no need for the * full unlink process. */ --- 1624,1630 ---- /* * Remove this child from the chain. This somewhat ! * repeats roff_node_unlink(), but since we're * just re-ordering, there's no need for the * full unlink process. */ *************** *** 1996,2002 **** mdoc->parse, np->line, np->pos, "%s after %s", mdoc_macronames[np->tok], mdoc_macronames[mdoc->last->tok]); ! mdoc_node_delete(mdoc, np); } if (NULL != (np = mdoc->last->last)) --- 1997,2003 ---- mdoc->parse, np->line, np->pos, "%s after %s", mdoc_macronames[np->tok], mdoc_macronames[mdoc->last->tok]); ! roff_node_delete(mdoc, np); } if (NULL != (np = mdoc->last->last)) *************** *** 2005,2011 **** np->line, np->pos, "%s at the end of %s", mdoc_macronames[np->tok], mdoc_macronames[mdoc->last->tok]); ! mdoc_node_delete(mdoc, np); } } --- 2006,2012 ---- np->line, np->pos, "%s at the end of %s", mdoc_macronames[np->tok], mdoc_macronames[mdoc->last->tok]); ! roff_node_delete(mdoc, np); } } *************** *** 2038,2044 **** mdoc->last->line, mdoc->last->pos, "%s before %s", mdoc_macronames[mdoc->last->tok], mdoc_macronames[n->tok]); ! mdoc_node_delete(mdoc, mdoc->last); } static void --- 2039,2045 ---- mdoc->last->line, mdoc->last->pos, "%s before %s", mdoc_macronames[mdoc->last->tok], mdoc_macronames[n->tok]); ! roff_node_delete(mdoc, mdoc->last); } static void *************** *** 2071,2077 **** mdoc->last->line, mdoc->last->pos, "%s after %s", mdoc_macronames[mdoc->last->tok], mdoc_macronames[np->tok]); ! mdoc_node_delete(mdoc, mdoc->last); } static void --- 2072,2078 ---- mdoc->last->line, mdoc->last->pos, "%s after %s", mdoc_macronames[mdoc->last->tok], mdoc_macronames[np->tok]); ! roff_node_delete(mdoc, mdoc->last); } static void *************** *** 2130,2136 **** free(datestr); } out: ! mdoc_node_delete(mdoc, n); } static void --- 2131,2137 ---- free(datestr); } out: ! roff_node_delete(mdoc, n); } static void *************** *** 2215,2221 **** nn->line, nn->pos, "Dt ... %s", nn->string); out: ! mdoc_node_delete(mdoc, n); } static void --- 2216,2222 ---- nn->line, nn->pos, "Dt ... %s", nn->string); out: ! roff_node_delete(mdoc, n); } static void *************** *** 2281,2287 **** #endif /*!OSNAME*/ out: ! mdoc_node_delete(mdoc, n); } /* --- 2282,2288 ---- #endif /*!OSNAME*/ out: ! roff_node_delete(mdoc, n); } /*