From e1ff3b5725e84a6aaa6367f03b0f19611f098f3e Mon Sep 17 00:00:00 2001 From: Paul Janzen Date: Thu, 10 Jun 1999 22:38:04 +0000 Subject: 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. --- sbin/fdisk/cmd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sbin/fdisk/cmd.c') 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); -- cgit v1.2.3