diff options
author | 2017-06-24 14:38:27 +0000 | |
---|---|---|
committer | 2017-06-24 14:38:27 +0000 | |
commit | f3476b07809a2097ff3cd2d357ae4d12f20c2c1d (patch) | |
tree | e69fdfe25b49db90b09b25644b1223b111a28405 /usr.bin/mandoc/man_validate.c | |
parent | Delete .St -p1003.1-2013. (diff) | |
download | wireguard-openbsd-f3476b07809a2097ff3cd2d357ae4d12f20c2c1d.tar.xz wireguard-openbsd-f3476b07809a2097ff3cd2d357ae4d12f20c2c1d.zip |
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@.
Diffstat (limited to 'usr.bin/mandoc/man_validate.c')
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index 3532ceb56c5..f527723319a 100644 --- a/usr.bin/mandoc/man_validate.c +++ b/usr.bin/mandoc/man_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_validate.c,v 1.101 2017/06/17 22:40:27 schwarze Exp $ */ +/* $OpenBSD: man_validate.c,v 1.102 2017/06/24 14:38:27 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org> @@ -171,7 +171,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 @@ -338,12 +340,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. */ |