From 332a2176094538e094fed8f1e5e251feb6b666e9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 17 Jun 2017 22:43:14 +0000 Subject: style message about missing RCS ids; inspired by mdoclint --- man_validate.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'man_validate.c') diff --git a/man_validate.c b/man_validate.c index 759c42ac..7426bfbb 100644 --- a/man_validate.c +++ b/man_validate.c @@ -170,6 +170,10 @@ check_root(CHKARGS) 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, NULL); } static void @@ -338,6 +342,10 @@ post_TH(CHKARGS) man->meta.os = mandoc_strdup(n->string); else if (man->defos != NULL) man->meta.os = mandoc_strdup(man->defos); + man->meta.os_e = man->meta.os == NULL ? MDOC_OS_OTHER : + strstr(man->meta.os, "OpenBSD") != NULL ? MDOC_OS_OPENBSD : + strstr(man->meta.os, "NetBSD") != NULL ? MDOC_OS_NETBSD : + MDOC_OS_OTHER; /* TITLE MSEC DATE OS ->VOL<- */ /* If missing, use the default VOL name for MSEC. */ -- cgit v1.2.3-56-ge451