summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2009-08-09 17:38:25 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2009-08-09 17:38:25 +0000
commit3d6e9a7c90ab50efceef698fea21419cca924cb1 (patch)
treea08e1663087c3c7846e6d5497f436cbcc149bbfd /usr.bin/mandoc/mdoc_validate.c
parentf9d2481b19b26bde9be4b90a2adc14c498e79faf (diff)
sync to 1.8.2: more .Bl -column fixes, in particular:
1) -column implies -compact 2) do not die from fewer columns than specified (more are still fatal)
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r--usr.bin/mandoc/mdoc_validate.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index cd0f3237df2..27d553cdfeb 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.31 2009/07/26 01:59:46 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.32 2009/08/09 17:38:24 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1024,11 +1024,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) {
+ 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;
}