summaryrefslogtreecommitdiffstats
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
commitf118bfae6ef1e4ffdb25aff50ea427616253f6ca (patch)
treed3468360c99d3b1f29da0ead9f56d50bb05082ca /main.c
parentcc7ec05a25c9d24fc87089bd37a6aa1fd17568eb (diff)
downloadmandoc-f118bfae6ef1e4ffdb25aff50ea427616253f6ca.tar.gz
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.c b/main.c
index 6c005a66..6c818252 100644
--- a/main.c
+++ b/main.c
@@ -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;