From nobody@FreeBSD.org  Sun May 13 14:20:25 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 9BE2C106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 May 2012 14:20:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8827C8FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 May 2012 14:20:25 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DEKPP1031064
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 May 2012 14:20:25 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q4DEKPqe031063;
	Sun, 13 May 2012 14:20:25 GMT
	(envelope-from nobody)
Message-Id: <201205131420.q4DEKPqe031063@red.freebsd.org>
Date: Sun, 13 May 2012 14:20:25 GMT
From: Oleg Ginzburg <olevole@olevole.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: man(1) empty zcat argument when is used plain old manpath
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167840
>Category:       misc
>Synopsis:       man(1) empty zcat argument when is used plain old manpath
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 13 14:30:04 UTC 2012
>Closed-Date:    Mon May 14 14:45:41 UTC 2012
>Last-Modified:  Mon May 14 14:45:41 UTC 2012
>Originator:     Oleg Ginzburg
>Release:        10-CURRENT
>Organization:
>Environment:
check on emptiness and support of catpages of a variable is necessary if it is
>Description:
if plain text man file are used, path to file stored in $catpage variables and $manpage remains empty. It breaks man_check_for_so from man(1) utility which tries to execute the "zcat -f" which will expect stdin. Check on emptiness and support for $catpage variable is necessary if this set.
>How-To-Repeat:
/usr/ports/archivers/rar ports, for example, used old style man:

% make -C /usr/ports/archivers/rar install
% rehash
% whereis rar
% man rar

it will hang to ctrl+d/ctrl+c 
>Fix:


Patch attached with submission follows:

--- usr.bin/man/man.sh-orig	2012-05-13 17:53:13.000000000 +0400
+++ usr.bin/man/man.sh	2012-05-13 17:53:49.000000000 +0400
@@ -255,6 +255,8 @@
 	local IFS line tstr
 
 	unset IFS
+        [ -z "${manpage}" -a -z "${catpage}" ] && return 0
+        [ -z "${manpage}" -a -n "${catpage}" ] && manpage=${catpage}
 
 	# We need to loop to accommodate multiple .so directives.
 	while true


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun May 13 15:25:20 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167840 
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Mon May 14 14:45:40 UTC 2012 
State-Changed-Why:  
duplicate of bin/163219. 

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