diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-20 15:05:34 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-20 15:05:34 +0000 |
commit | 21a0f9a1a5bc29abdffea3529d79a09932397e4a (patch) | |
tree | 4faa846232af7818300dd7ff187c8dcddda6d9b5 /mdoc_validate.c | |
parent | a230269a41845b9f72616b3c61dc910ab46e7d1a (diff) | |
download | mandoc-21a0f9a1a5bc29abdffea3529d79a09932397e4a.tar.gz |
Undocumented behaviour in groff: `Bl -column' implies `-compact'.
mandoc now allows fewer columns than the -width specifies.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 2c7dba22..2f1fa122 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -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) { + 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; } |