From c68846c0d305ab706961195ef5ce135dab26fba9 Mon Sep 17 00:00:00 2001 From: schwarze Date: Fri, 16 Jan 2015 21:12:01 +0000 Subject: [PATCH] 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@. --- usr.bin/mandoc/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -18,6 +18,7 @@ */ #include +#include /* MACHINE */ #include #include @@ -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; -- 2.20.1