aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-01-16 21:15:05 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-01-16 21:15:05 +0000
commit668d4d545d8d492db11e35f07ea7744ff322935a (patch)
treee9515914a0e5c777b3d1b37f633a52f2d4bf1069 /main.c
parente48e269e1bbe5594d18319db436164150a8fa7bc (diff)
downloadmandoc-668d4d545d8d492db11e35f07ea7744ff322935a.tar.gz
mandoc-668d4d545d8d492db11e35f07ea7744ff322935a.tar.zst
mandoc-668d4d545d8d492db11e35f07ea7744ff322935a.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@.
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index a79523bf..30e076f2 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.215 2015/01/15 04:26:39 schwarze Exp $ */
+/* $Id: main.c,v 1.216 2015/01/16 21:15:05 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -19,6 +19,7 @@
#include "config.h"
#include <sys/types.h>
+#include <sys/param.h> /* MACHINE */
#include <assert.h>
#include <ctype.h>
@@ -328,6 +329,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;