From owner-freebsd-bugs Sat Jun 29 8:30:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FD2D37B400 for ; Sat, 29 Jun 2002 08:30:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3DD843E09 for ; Sat, 29 Jun 2002 08:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g5TFU3JU020518 for ; Sat, 29 Jun 2002 08:30:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5TFU3CN020517; Sat, 29 Jun 2002 08:30:03 -0700 (PDT) Date: Sat, 29 Jun 2002 08:30:03 -0700 (PDT) Message-Id: <200206291530.g5TFU3CN020517@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "dave" Subject: Re: bin/37662: man(1) fails to display anything if $PAGER is set but blank Reply-To: "dave" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/37662; it has been noted by GNATS. From: "dave" To: Cc: , 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