From a70f21c0692d63a23e666b09912d21d50f61f0cb Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 24 Jun 2017 14:38:32 +0000 Subject: Split -Wstyle into -Wstyle and the even lower -Wbase, and add -Wopenbsd and -Wnetbsd to check conventions for the base system of a specific operating system. Mark operating system specific messages with "(OpenBSD)" at the end. Please use just "-Tlint" to check base system manuals (defaulting to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the manuals of portable software projects you maintain that are not part of OpenBSD base, to avoid bogus recommendations about base system conventions that do not apply. Issue originally reported by semarie@, solution using an idea from tedu@, discussed with jmc@ and jca@. --- man_validate.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'man_validate.c') diff --git a/man_validate.c b/man_validate.c index 7426bfbb..e874cabb 100644 --- a/man_validate.c +++ b/man_validate.c @@ -173,7 +173,9 @@ check_root(CHKARGS) if (man->meta.os_e && (man->meta.rcsids & (1 << man->meta.os_e)) == 0) - mandoc_msg(MANDOCERR_RCS_MISSING, man->parse, 0, 0, NULL); + mandoc_msg(MANDOCERR_RCS_MISSING, man->parse, 0, 0, + man->meta.os_e == MANDOC_OS_OPENBSD ? + "(OpenBSD)" : "(NetBSD)"); } static void @@ -340,12 +342,14 @@ post_TH(CHKARGS) if (n && (n = n->next)) 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; + 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. */ -- cgit v1.2.3-56-ge451