=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_validate.c,v retrieving revision 1.91 retrieving revision 1.92 diff -c -r1.91 -r1.92 *** src/usr.bin/mandoc/mdoc_validate.c 2011/04/21 22:59:54 1.91 --- src/usr.bin/mandoc/mdoc_validate.c 2011/04/24 16:22:02 1.92 *************** *** 1,4 **** ! /* $Id: mdoc_validate.c,v 1.91 2011/04/21 22:59:54 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze --- 1,4 ---- ! /* $Id: mdoc_validate.c,v 1.92 2011/04/24 16:22:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze *************** *** 29,34 **** --- 29,35 ---- #include #include + #include "mdoc.h" #include "mandoc.h" #include "libmdoc.h" #include "libmandoc.h" *************** *** 150,158 **** static v_post posts_ns[] = { post_ns, NULL }; static v_post posts_os[] = { post_os, post_prol, NULL }; static v_post posts_rs[] = { post_rs, NULL }; ! static v_post posts_sh[] = { post_ignpar, hwarn_ge1, bwarn_ge1, post_sh, NULL }; static v_post posts_sp[] = { ewarn_le1, NULL }; ! static v_post posts_ss[] = { post_ignpar, hwarn_ge1, bwarn_ge1, NULL }; static v_post posts_st[] = { post_st, NULL }; static v_post posts_std[] = { post_std, NULL }; static v_post posts_text[] = { ewarn_ge1, NULL }; --- 151,159 ---- static v_post posts_ns[] = { post_ns, NULL }; static v_post posts_os[] = { post_os, post_prol, NULL }; static v_post posts_rs[] = { post_rs, NULL }; ! static v_post posts_sh[] = { post_ignpar, hwarn_ge1, post_sh, NULL }; static v_post posts_sp[] = { ewarn_le1, NULL }; ! static v_post posts_ss[] = { post_ignpar, hwarn_ge1, NULL }; static v_post posts_st[] = { post_st, NULL }; static v_post posts_std[] = { post_std, NULL }; static v_post posts_text[] = { ewarn_ge1, NULL }; *************** *** 442,448 **** } t = lvl == CHECK_WARN ? MANDOCERR_ARGCWARN : MANDOCERR_ARGCOUNT; ! mdoc_vmsg(m, t, m->last->line, m->last->pos, "want %s%d children (have %d)", p, val, m->last->nchild); return(1); --- 443,449 ---- } t = lvl == CHECK_WARN ? MANDOCERR_ARGCWARN : MANDOCERR_ARGCOUNT; ! mandoc_vmsg(t, m->parse, m->last->line, m->last->pos, "want %s%d children (have %d)", p, val, m->last->nchild); return(1); *************** *** 577,586 **** (t == n->parent->type)) return(1); ! mdoc_vmsg(mdoc, MANDOCERR_SYNTCHILD, ! n->line, n->pos, "want parent %s", ! MDOC_ROOT == t ? "" : ! mdoc_macronames[tok]); return(0); } --- 578,586 ---- (t == n->parent->type)) return(1); ! mandoc_vmsg(MANDOCERR_SYNTCHILD, mdoc->parse, n->line, ! n->pos, "want parent %s", MDOC_ROOT == t ? ! "" : mdoc_macronames[tok]); return(0); } *************** *** 1328,1334 **** else er = MANDOCERR_SYNTARGCOUNT; ! mdoc_vmsg(mdoc, er, mdoc->last->line, mdoc->last->pos, "columns == %d (have %d)", cols, i); return(MANDOCERR_ARGCOUNT == er); default: --- 1328,1335 ---- else er = MANDOCERR_SYNTARGCOUNT; ! mandoc_vmsg(er, mdoc->parse, mdoc->last->line, ! mdoc->last->pos, "columns == %d (have %d)", cols, i); return(MANDOCERR_ARGCOUNT == er); default: *************** *** 1997,2012 **** n = mdoc->last; if (NULL == n->child || '\0' == n->child->string[0]) { ! mdoc->meta.date = mandoc_normdate(NULL, ! mdoc->msg, mdoc->data, n->line, n->pos); return(1); } if ( ! concat(mdoc, buf, n->child, DATESIZE)) return(0); ! mdoc->meta.date = mandoc_normdate(buf, ! mdoc->msg, mdoc->data, n->line, n->pos); return(1); } --- 1998,2013 ---- n = mdoc->last; if (NULL == n->child || '\0' == n->child->string[0]) { ! mdoc->meta.date = mandoc_normdate ! (mdoc->parse, NULL, n->line, n->pos); return(1); } if ( ! concat(mdoc, buf, n->child, DATESIZE)) return(0); ! mdoc->meta.date = mandoc_normdate ! (mdoc->parse, buf, n->line, n->pos); return(1); } *************** *** 2189,2195 **** return(0); } #else /*!OSNAME */ ! if (uname(&utsname)) { mdoc_nmsg(mdoc, n, MANDOCERR_UNAME); mdoc->meta.os = mandoc_strdup("UNKNOWN"); return(post_prol(mdoc)); --- 2190,2196 ---- return(0); } #else /*!OSNAME */ ! if (-1 == uname(&utsname)) { mdoc_nmsg(mdoc, n, MANDOCERR_UNAME); mdoc->meta.os = mandoc_strdup("UNKNOWN"); return(post_prol(mdoc));