=================================================================== RCS file: /cvs/mandoc/Attic/validate.c,v retrieving revision 1.72 retrieving revision 1.77 diff -u -p -r1.72 -r1.77 --- mandoc/Attic/validate.c 2009/03/08 11:48:44 1.72 +++ mandoc/Attic/validate.c 2009/03/09 13:17:50 1.77 @@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.72 2009/03/08 11:48:44 kristaps Exp $ */ +/* $Id: validate.c,v 1.77 2009/03/09 13:17:50 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -16,6 +16,8 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +#include + #include #include #include @@ -298,6 +300,8 @@ const struct valids mdoc_valids[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { NULL, posts_notext }, /* Ud */ { pres_lb, posts_lb }, /* Lb */ + { NULL, NULL }, /* Lb */ + { NULL, posts_pp }, /* Pp */ }; @@ -638,6 +642,7 @@ check_args(struct mdoc *m, const struct mdoc_node *n) if (NULL == n->args) return(1); + assert(n->args->argc); for (i = 0; i < (int)n->args->argc; i++) if ( ! check_argv(m, n, &n->args->argv[i])) return(0); @@ -684,8 +689,12 @@ check_text(struct mdoc *mdoc, int line, int pos, const p += (int)c - 1; continue; } - return(mdoc_perr(mdoc, line, pos, - "invalid escape sequence: %s", p)); + if ( ! (MDOC_IGN_ESCAPE & mdoc->pflags)) + return(mdoc_perr(mdoc, line, pos, + "invalid escape sequence")); + if ( ! mdoc_pwarn(mdoc, line, pos, WARN_SYNTAX, + "invalid escape sequence")) + return(0); } return(1); @@ -891,7 +900,7 @@ static int pre_an(PRE_ARGS) { - if (n->args && 1 >= n->args->argc) + if (NULL == n->args || 1 == n->args->argc) return(1); return(mdoc_nerr(mdoc, n, "only one argument allowed")); }