Date: Sat, 29 Jun 2002 08:30:03 -0700 (PDT) From: "dave" <erigol@optushome.com.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/37662: man(1) fails to display anything if $PAGER is set but blank Message-ID: <200206291530.g5TFU3CN020517@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/37662; it has been noted by GNATS.
From: "dave" <erigol@optushome.com.au>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc: <pgl@yoyo.org>, <eric@FreeBSD.org>
Subject: Re: bin/37662: man(1) fails to display anything if $PAGER is set but blank
Date: Sun, 30 Jun 2002 01:23:58 +1000
Upon re-reading, maybe this, or something similiar would be the appropriate
solution? Not sure exactly if this handles errors in the correct way. Feel
free to change at will!
--- man.c.orig Sun Jun 30 00:49:28 2002
+++ man.c Sun Jun 30 01:17:26 2002
@@ -836,10 +836,16 @@
{
char *expander = get_expander (file);
- if (expander != NULL)
+ if (expander != NULL && pager != NULL && *pager != '\0')
snprintf (command, sizeof(command), "%s %s | %s", expander, file,
pager);
- else
+ else if (expander != NULL && pager != NULL && *pager == '\0')
+ snprintf (command, sizeof(command), "%s %s", expander, file);
+ else if (pager != NULL && *pager != '\0')
snprintf (command, sizeof(command), "%s %s", pager, file);
+ else {
+ perror("no expander or pager. do not know how to display manpage");
+ exit(1);
+ }
found = do_system_command (command);
}
Dave
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206291530.g5TFU3CN020517>
