diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 1999-06-10 22:38:04 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 1999-06-10 22:38:04 +0000 |
commit | e1ff3b5725e84a6aaa6367f03b0f19611f098f3e (patch) | |
tree | 58448540b9be32681cb4a1e7924a7f2fb418b574 /sbin/fdisk/cmd.c | |
parent | 91e387e025fd867bb2fa8137068dae52cea527a5 (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/fdisk/cmd.c')
-rw-r--r-- | sbin/fdisk/cmd.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); |