summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1999-06-10 22:38:04 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1999-06-10 22:38:04 +0000
commite1ff3b5725e84a6aaa6367f03b0f19611f098f3e (patch)
tree58448540b9be32681cb4a1e7924a7f2fb418b574 /sbin
parent91e387e025fd867bb2fa8137068dae52cea527a5 (diff)
Handle PAGER in a manner consistent with the Single Unix Specification:
that is, use PAGER rather than "more" if it is defined and non-null, not just if it is defined.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/editor.c6
-rw-r--r--sbin/fdisk/cmd.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index a85aa926bf6..57402965be6 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.64 1999/06/06 18:42:29 aaron Exp $ */
+/* $OpenBSD: editor.c,v 1.65 1999/06/10 22:37:54 pjanzen Exp $ */
/*
* Copyright (c) 1997-1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.64 1999/06/06 18:42:29 aaron Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.65 1999/06/10 22:37:54 pjanzen Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -309,7 +309,7 @@ editor(lp, f, dev, fstabfile)
char *pager;
extern char manpage[];
- if ((pager = getenv("PAGER")) == NULL)
+ if ((pager = getenv("PAGER")) == NULL || *pager == '\0')
pager = _PATH_LESS;
if ((fp = popen(pager, "w")) != NULL) {
(void) fwrite(manpage, strlen(manpage), 1, fp);
diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c
index 88193040b5b..0e2949bd163 100644
--- a/sbin/fdisk/cmd.c
+++ b/sbin/fdisk/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.20 1998/09/14 03:54:34 rahnds Exp $ */
+/* $OpenBSD: cmd.c,v 1.21 1999/06/10 22:38:01 pjanzen Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -384,12 +384,13 @@ Xmanual(cmd, disk, mbr, tt, offset)
int offset;
{
char *pager = "/usr/bin/less";
+ char *p;
sig_t opipe = signal(SIGPIPE, SIG_IGN);
extern char manpage[];
FILE *f;
- if (getenv("PAGER"))
- pager = getenv("PAGER");
+ if ((p = getenv("PAGER")) != NULL && (*p != '\0'))
+ pager = p;
f = popen(pager, "w");
if (f) {
(void) fwrite(manpage, strlen(manpage), 1, f);