- if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) &&
- ! (MDOC_PBODY & m->flags)) {
- if ( ! mdoc_pmsg(m, ln, pp, MANDOCERR_BADPROLOG))
- 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;
+ if (mdoc->flags & MDOC_PBODY) {
+ if (tok == MDOC_Dt) {
+ mandoc_vmsg(MANDOCERR_DT_LATE,
+ mdoc->parse, line, ppos,
+ "Dt %s", buf + *pos);
+ return(1);
+ }
+ } else if ( ! (mdoc_macros[tok].flags & MDOC_PROLOGUE)) {
+ if (mdoc->meta.title == NULL) {
+ mandoc_vmsg(MANDOCERR_DT_NOTITLE,
+ mdoc->parse, line, ppos, "%s %s",
+ mdoc_macronames[tok], buf + *pos);
+ mdoc->meta.title = mandoc_strdup("UNTITLED");
+ }
+ if (NULL == mdoc->meta.vol)
+ mdoc->meta.vol = mandoc_strdup("LOCAL");
+ mdoc->flags |= MDOC_PBODY;