=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.193 retrieving revision 1.194 diff -c -r1.193 -r1.194 *** src/usr.bin/mandoc/mdoc_validate.c 2015/02/10 08:05:07 1.193 --- src/usr.bin/mandoc/mdoc_validate.c 2015/02/12 12:20:47 1.194 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_validate.c,v 1.193 2015/02/10 08:05:07 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_validate.c,v 1.194 2015/02/12 12:20:47 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze *************** *** 323,329 **** n = mdoc->last; if (n->flags & MDOC_VALID) return; ! n->flags |= MDOC_VALID; switch (n->type) { case MDOC_TEXT: --- 323,329 ---- n = mdoc->last; if (n->flags & MDOC_VALID) return; ! n->flags |= MDOC_VALID | MDOC_ENDED; switch (n->type) { case MDOC_TEXT: *************** *** 414,437 **** static void pre_bl(PRE_ARGS) { - struct mdoc_node *np; struct mdoc_argv *argv, *wa; int i; enum mdocargt mdoclt; enum mdoc_list lt; ! if (MDOC_BLOCK != n->type) { ! if (ENDBODY_NOT != n->end) { ! assert(n->pending); ! np = n->pending->parent; ! } else ! np = n->parent; ! ! assert(np); ! assert(MDOC_BLOCK == np->type); ! assert(MDOC_Bl == np->tok); return; - } /* * First figure out which kind of list to use: bind ourselves to --- 414,426 ---- static void pre_bl(PRE_ARGS) { struct mdoc_argv *argv, *wa; int i; enum mdocargt mdoclt; enum mdoc_list lt; ! if (n->type != MDOC_BLOCK) return; /* * First figure out which kind of list to use: bind ourselves to *************** *** 607,631 **** static void pre_bd(PRE_ARGS) { - struct mdoc_node *np; struct mdoc_argv *argv; int i; enum mdoc_disp dt; pre_literal(mdoc, n); ! if (MDOC_BLOCK != n->type) { ! if (ENDBODY_NOT != n->end) { ! assert(n->pending); ! np = n->pending->parent; ! } else ! np = n->parent; ! ! assert(np); ! assert(MDOC_BLOCK == np->type); ! assert(MDOC_Bd == np->tok); return; - } for (i = 0; n->args && i < (int)n->args->argc; i++) { argv = n->args->argv + i; --- 596,609 ---- static void pre_bd(PRE_ARGS) { struct mdoc_argv *argv; int i; enum mdoc_disp dt; pre_literal(mdoc, n); ! if (n->type != MDOC_BLOCK) return; for (i = 0; n->args && i < (int)n->args->argc; i++) { argv = n->args->argv + i; *************** *** 795,816 **** * element, which contains the goods. */ ! if (MDOC_HEAD != mdoc->last->type) { ! if (ENDBODY_NOT != mdoc->last->end) { ! assert(mdoc->last->pending); ! np = mdoc->last->pending->parent->head; ! } else if (MDOC_BLOCK != mdoc->last->type) { ! np = mdoc->last->parent->head; ! } else ! np = mdoc->last->head; ! ! assert(np); ! assert(MDOC_HEAD == np->type); ! assert(MDOC_Bf == np->tok); return; - } - np = mdoc->last; assert(MDOC_BLOCK == np->parent->type); assert(MDOC_Bf == np->parent->tok); --- 773,782 ---- * element, which contains the goods. */ ! np = mdoc->last; ! if (MDOC_HEAD != np->type) return; assert(MDOC_BLOCK == np->parent->type); assert(MDOC_Bf == np->parent->tok);