X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/0e7a74d9cb86b8c50cb55a8052add204dd072cb5..e5a4a92d5887db0f1c00568a41c411a1556f8774:/mdoc_validate.c?ds=inline diff --git a/mdoc_validate.c b/mdoc_validate.c index 433ba11a..797642aa 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.35 2009/07/17 12:27:49 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.39 2009/07/23 08:36:32 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -862,7 +862,7 @@ post_bf(POST_ARGS) return(1); else if (0 == strcmp(p, "Li")) return(1); - else if (0 == strcmp(p, "Sm")) + else if (0 == strcmp(p, "Sy")) return(1); return(mdoc_nerr(mdoc, head, EFONT)); @@ -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; + } else if (i == cols) break; - return(mdoc_verr(mdoc, mdoc->last->line, mdoc->last->pos, - "column mismatch (have %d, want %d)", - i, cols)); + + return(mdoc_verr(mdoc, mdoc->last->line, + mdoc->last->pos, "column mismatch: " + "have %d, want %d", i, cols)); default: break; } @@ -1138,6 +1147,8 @@ post_sp(POST_ARGS) if (NULL == mdoc->last->child) return(1); + else if ( ! eerr_eq1(mdoc)) + return(0); assert(MDOC_TEXT == mdoc->last->child->type); buf = mdoc->last->child->string; @@ -1150,7 +1161,7 @@ post_sp(POST_ARGS) return(mdoc_nerr(mdoc, mdoc->last->child, ENUMFMT)); if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) || - (lval > INT_MAX || lval < INT_MIN)) + (lval > INT_MAX || lval < 0)) return(mdoc_nerr(mdoc, mdoc->last->child, ENUMFMT)); return(1);