=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- src/usr.bin/mandoc/mdoc.c 2010/04/03 16:24:17 1.38 +++ src/usr.bin/mandoc/mdoc.c 2010/04/04 20:14:35 1.39 @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.38 2010/04/03 16:24:17 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.39 2010/04/04 20:14:35 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -22,6 +22,7 @@ #include #include #include +#include #include "libmdoc.h" #include "libmandoc.h" @@ -350,8 +351,19 @@ MDOC_PBODY & m->flags) return(mdoc_perr(m, ln, pp, EPROLBODY)); if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) && - ! (MDOC_PBODY & m->flags)) - return(mdoc_perr(m, ln, pp, EBODYPROL)); + ! (MDOC_PBODY & m->flags)) { + if ( ! mdoc_pwarn(m, ln, pp, EBODYPROL)) + return(0); + if (NULL == m->meta.title) + m->meta.title = mandoc_strdup("unknown"); + if (NULL == m->meta.vol) + m->meta.vol = mandoc_strdup("local"); + if (NULL == m->meta.os) + m->meta.os = mandoc_strdup("local"); + if (0 == m->meta.date) + m->meta.date = time(NULL); + m->flags |= MDOC_PBODY; + } return((*mdoc_macros[tok].fp)(m, tok, ln, pp, pos, buf)); }