=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.37 retrieving revision 1.41 diff -u -p -r1.37 -r1.41 --- mandoc/mdoc_validate.c 2009/07/18 23:31:04 1.37 +++ mandoc/mdoc_validate.c 2009/07/25 16:03:03 1.41 @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.37 2009/07/18 23:31:04 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.41 2009/07/25 16:03:03 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -912,7 +912,7 @@ post_an(POST_ARGS) if (mdoc->last->args) { if (NULL == mdoc->last->child) return(1); - return(mdoc_nerr(mdoc, mdoc->last, ELINE)); + return(mdoc_nerr(mdoc, mdoc->last, ENOLINE)); } if (mdoc->last->child) @@ -1028,11 +1028,20 @@ post_it(POST_ARGS) c = mdoc->last->child; for (i = 0; c && MDOC_HEAD == c->type; c = c->next) i++; - if (i == cols) + + if (i < cols || i == (cols + 1)) { + if ( ! mdoc_vwarn(mdoc, mdoc->last->line, + mdoc->last->pos, "column " + "mismatch: have %d, want %d", + i, cols)) + return(0); break; - return(mdoc_verr(mdoc, mdoc->last->line, mdoc->last->pos, - "column mismatch (have %d, want %d)", - i, cols)); + } else if (i == cols) + break; + + return(mdoc_verr(mdoc, mdoc->last->line, + mdoc->last->pos, "column mismatch: " + "have %d, want %d", i, cols)); default: break; } @@ -1210,6 +1219,7 @@ post_sh_body(POST_ARGS) return(0); } + assert(n); if (MDOC_BLOCK == n->type && MDOC_Nd == n->tok) return(1); return(mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC));