diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-16 21:15:05 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-16 21:15:05 +0000 |
commit | 668d4d545d8d492db11e35f07ea7744ff322935a (patch) | |
tree | e9515914a0e5c777b3d1b37f633a52f2d4bf1069 | |
parent | e48e269e1bbe5594d18319db436164150a8fa7bc (diff) | |
download | mandoc-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@.
-rw-r--r-- | main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; |