summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-09-16 22:52:02 +0000
committerwosch <wosch@FreeBSD.org>1996-09-16 22:52:02 +0000
commit7393f67a3ada5f2ccabaa342bc00a7238c3b57f6 (patch)
tree6be1d4da0ac5ba374a39646b71aa32ef8262b620 /gnu
parentea1853644ebb937ab3a6063f04db8c8f35a8853f (diff)
downloadFreeBSD-src-7393f67a3ada5f2ccabaa342bc00a7238c3b57f6.zip
FreeBSD-src-7393f67a3ada5f2ccabaa342bc00a7238c3b57f6.tar.gz
Set enviroment variable PAGER=pager if using option `man -P pager'
This inherit variable PAGER for childs like whatis(1), e.g. `man -P less -k man' should now work like expected. Close PR#1068
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/man/man/man.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c
index 510dae6..e9259b9 100644
--- a/gnu/usr.bin/man/man/man.c
+++ b/gnu/usr.bin/man/man/man.c
@@ -315,6 +315,8 @@ man_getopt (argc, argv)
break;
case 'P':
pager = strdup (optarg);
+ if (setenv("PAGER", pager, 1) != 0)
+ (void)fprintf(stderr, "setenv PAGER=%s\n", pager);
break;
case 'S':
colon_sep_section_list = strdup (optarg);
OpenPOWER on IntegriCloud