diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-04-05 08:59:46 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-04-05 08:59:46 +0000 |
commit | 1edec9cc4a5ff272a74ba07eaa7331ac21e3b3bb (patch) | |
tree | dd36c8dc1f63ad12e3e3058ccd5573d44a25fff2 /mdoc.c | |
parent | 7712235518f4f0e8306d12c39d6a78320510875b (diff) | |
download | mandoc-1edec9cc4a5ff272a74ba07eaa7331ac21e3b3bb.tar.gz |
Commited relaxation of title-less document error-out noted by Christian Weisgerber and patched by Ingo Schwarze.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -26,6 +26,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include "libmdoc.h" #include "libmandoc.h" @@ -351,8 +352,22 @@ mdoc_macro(struct mdoc *m, enum mdoct tok, * we're in the body, deny prologue calls. */ if (MDOC_PROLOGUE & mdoc_macros[tok].flags && - MDOC_PBODY & m->flags) - return(mdoc_perr(m, ln, pp, EPROLBODY)); + MDOC_PBODY & m->flags) { + if ( ! mdoc_pwarn(m, ln, pp, EBODYPROL)) + return(0); + /* + * FIXME: do this in mdoc_action.c. + */ + 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; + } if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) && ! (MDOC_PBODY & m->flags)) return(mdoc_perr(m, ln, pp, EBODYPROL)); |