/* $OpenBSD$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
NULL, /* EE */
post_UR, /* UR */
NULL, /* UE */
+ post_UR, /* MT */
+ NULL, /* ME */
};
static const v_check *man_valids = __man_valids - MAN_TH;
case ROFFT_ROOT:
check_root(man, n);
break;
+ case ROFFT_COMMENT:
case ROFFT_EQN:
case ROFFT_TBL:
break;
static void
check_root(CHKARGS)
{
-
assert((man->flags & (MAN_BLINE | MAN_ELINE)) == 0);
- if (NULL == man->first->child)
+ if (n->last == NULL || n->last->type == ROFFT_COMMENT)
mandoc_msg(MANDOCERR_DOC_EMPTY, man->parse,
n->line, n->pos, NULL);
else
man->meta.date = man->quick ? mandoc_strdup("") :
mandoc_normdate(man, NULL, n->line, n->pos);
}
+
+ if (man->meta.os_e &&
+ (man->meta.rcsids & (1 << man->meta.os_e)) == 0)
+ mandoc_msg(MANDOCERR_RCS_MISSING, man->parse, 0, 0,
+ man->meta.os_e == MANDOC_OS_OPENBSD ?
+ "(OpenBSD)" : "(NetBSD)");
}
static void
static void
post_UR(CHKARGS)
{
-
if (n->type == ROFFT_HEAD && n->child == NULL)
- mandoc_vmsg(MANDOCERR_UR_NOHEAD, man->parse,
- n->line, n->pos, "UR");
+ mandoc_msg(MANDOCERR_UR_NOHEAD, man->parse,
+ n->line, n->pos, roff_name[n->tok]);
check_part(man, n);
}
if (n && (n = n->next))
man->meta.os = mandoc_strdup(n->string);
- else if (man->defos != NULL)
- man->meta.os = mandoc_strdup(man->defos);
+ else if (man->os_s != NULL)
+ man->meta.os = mandoc_strdup(man->os_s);
+ if (man->meta.os_e == MANDOC_OS_OTHER && man->meta.os != NULL) {
+ if (strstr(man->meta.os, "OpenBSD") != NULL)
+ man->meta.os_e = MANDOC_OS_OPENBSD;
+ else if (strstr(man->meta.os, "NetBSD") != NULL)
+ man->meta.os_e = MANDOC_OS_NETBSD;
+ }
/* TITLE MSEC DATE OS ->VOL<- */
/* If missing, use the default VOL name for MSEC. */