summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-01-16 21:12:01 +0000
committerschwarze <schwarze@openbsd.org>2015-01-16 21:12:01 +0000
commitc68846c0d305ab706961195ef5ce135dab26fba9 (patch)
treed892bc7a885a4d6f6555cd1233e5ebdc5a17382c
parentConstify the driver name to disk type table, and remove rz and ccd from that (diff)
downloadwireguard-openbsd-c68846c0d305ab706961195ef5ce135dab26fba9.tar.xz
wireguard-openbsd-c68846c0d305ab706961195ef5ce135dab26fba9.zip
Let man(1) show manuals for the current architecture by default,
and support the MACHINE environment variable as documented in man(1). Missing feature reported by pascal@.
-rw-r--r--usr.bin/mandoc/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index c19fd36527a..60657a67b4e 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.121 2015/01/15 04:26:06 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.122 2015/01/16 21:12:01 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -18,6 +18,7 @@
*/
#include <sys/types.h>
+#include <sys/param.h> /* MACHINE */
#include <assert.h>
#include <ctype.h>
@@ -300,6 +301,10 @@ main(int argc, char *argv[])
argv++;
argc--;
}
+ if (search.arch == NULL)
+ search.arch = getenv("MACHINE");
+ if (search.arch == NULL)
+ search.arch = MACHINE;
}
rc = MANDOCLEVEL_OK;