From yuri.pankov@gmail.com  Tue Dec 13 02:04:31 2011
Return-Path: <yuri.pankov@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 204641065670
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Dec 2011 02:04:31 +0000 (UTC)
	(envelope-from yuri.pankov@gmail.com)
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182])
	by mx1.freebsd.org (Postfix) with ESMTP id A09DC8FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Dec 2011 02:04:30 +0000 (UTC)
Received: by eaaf13 with SMTP id f13so1250903eaa.13
        for <FreeBSD-gnats-submit@freebsd.org>; Mon, 12 Dec 2011 18:04:29 -0800 (PST)
Received: by 10.14.14.80 with SMTP id c56mr3401532eec.197.1323741867488;
        Mon, 12 Dec 2011 18:04:27 -0800 (PST)
Received: from procyon.xvoid.org ([213.132.76.142])
        by mx.google.com with ESMTPS id m53sm655665eeb.8.2011.12.12.18.04.25
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 12 Dec 2011 18:04:26 -0800 (PST)
Received: from procyon.xvoid.org (yuri@procyon.xvoid.org [IPv6:::1])
	by procyon.xvoid.org (8.14.5/8.14.5) with ESMTP id pBD24N4T045578
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Dec 2011 06:04:23 +0400 (MSK)
	(envelope-from yuri.pankov@gmail.com)
Received: (from yuri@localhost)
	by procyon.xvoid.org (8.14.5/8.14.5/Submit) id pBD24Nuu045577;
	Tue, 13 Dec 2011 06:04:23 +0400 (MSK)
	(envelope-from yuri.pankov@gmail.com)
Message-Id: <201112130204.pBD24Nuu045577@procyon.xvoid.org>
Date: Tue, 13 Dec 2011 06:04:23 +0400 (MSK)
From: Yuri Pankov <yuri.pankov@gmail.com>
Reply-To: Yuri Pankov <yuri.pankov@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] man: fix 'zcat: standard input is a terminal -- ignoring' when only formatted version of manpage exists
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         163219
>Category:       bin
>Synopsis:       [patch] man: fix 'zcat: standard input is a terminal -- ignoring' when only formatted version of manpage exists
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          analyzed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 13 02:10:08 UTC 2011
>Closed-Date:    
>Last-Modified:  Wed Jul 03 00:53:00 UTC 2013
>Originator:     Yuri Pankov
>Release:        FreeBSD 9.0-RC3 amd64
>Organization:
>Environment:
System: FreeBSD procyon.xvoid.org 9.0-RC3 FreeBSD 9.0-RC3 #1 r228385: Sat Dec 10 07:29:02 MSK 2011 yuri@procyon.xvoid.org:/usr/obj/data/src/freebsd/releng/9.0/sys/GENERIC amd64
>Description:
/usr/bin/man emits a 'zcat: standard input is a terminal -- ignoring' when only formatted version of the manpage exists - coming from man_check_for_so. Just return there if `manpage' is an empty string.
>How-To-Repeat:
run catman; remove /usr/share/man/man1/man.1.gz; run man man:
procyon:yuri:~$ man -d man
-- Using architecture: amd64:amd64
-- Using pager: less -ins
-- Using manual sections: 1:1aout:8:2:3:n:4:5:6:7:9:l
-- Searching PATH for man directories
--   Adding /usr/share/man to manpath
--   Adding /usr/local/man to manpath
-- Adding default manpath entries
--   Adding /usr/share/openssl/man to manpath
-- Parsing config file: /usr/local/etc/man.d/perl5.12.4.conf
--   Adding /usr/local/lib/perl5/5.12.4/man to manpath
--   Adding /usr/local/lib/perl5/5.12.4/perl/man to manpath
-- Using manual path: /usr/share/man:/usr/local/man:/usr/share/openssl/man:/usr/local/lib/perl5/5.12.4/man:/usr/local/lib/perl5/5.12.4/perl/man
-- Using locale paths: en_US.UTF-8:en.UTF-8:.
-- Using standard page width
-- Searching for man
--     Found catpage /usr/share/man/cat1/man.1.gz
zcat: standard input is a terminal -- ignoring
-- Command: /usr/bin/zcat /usr/share/man/cat1/man.1.gz | less -ins
>Fix:
--- man.sh.diff begins here ---
Index: usr.bin/man/man.sh
===================================================================
--- usr.bin/man/man.sh	(revision 228449)
+++ usr.bin/man/man.sh	(working copy)
@@ -256,6 +256,11 @@
 
 	unset IFS
 
+	# We can be called with empty `manpage' if only cat page exists
+	if ! [ $manpage ]; then
+		return 0
+	fi
+
 	# We need to loop to accommodate multiple .so directives.
 	while true
 	do
--- man.sh.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gtetlow 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Thu Jan 19 03:09:15 UTC 2012 
Responsible-Changed-Why:  
assign to author 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163219 
State-Changed-From-To: open->analyzed 
State-Changed-By: gordon 
State-Changed-When: Wed Apr 11 22:04:13 PDT 2012 
State-Changed-Why:  
Finally got some time to look at this. While the patch as submitted would 
work, I'm going to see if I can fix the underlying architectural issue 
that is causing the problem. 


Responsible-Changed-From-To: gtetlow->gordon 
Responsible-Changed-By: gordon 
Responsible-Changed-When: Wed Apr 11 22:04:13 PDT 2012 
Responsible-Changed-Why:  
Finally got some time to look at this. While the patch as submitted would 
work, I'm going to see if I can fix the underlying architectural issue 
that is causing the problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163219 
State-Changed-From-To: analyzed->analyzed 
State-Changed-By: linimon 
State-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
State-Changed-Why:  
commit bit has been taken in for safekeeping. 


Responsible-Changed-From-To: gordon->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=163219 
>Unformatted:
