Subject: bin/170: man -w problem
To: None <gnats-admin>
From: Keith White <kwhite@csi.uottawa.ca>
List: netbsd-bugs
Date: 03/17/1994 06:50:01
>Number:         170
>Category:       bin
>Synopsis:       redirection of 'man -w' has unexpected result
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 17 06:50:01 1994
>Originator:     Keith White
>Organization:
Department of Computer Science, University of Ottawa
>Release:        netbsd-current
>Environment:
	
System: NetBSD kewbat 0.9a KEWBAT#7 i386


>Description:
	If you redirect the output of 'man -w' you get the contents of 
the manpage rather than the expected list of pathnames.
	
>How-To-Repeat:
Not for the unwary!

	ls -l `man -w man`
	
>Fix:

% what /usr/bin/man
/usr/bin/man
        config.c        8.5 (Berkeley) 11/26/93
         Copyright (c) 1987, 1993
        man.c   8.13 (Berkeley) 12/20/93

The following patch fixes the problem:


*** man.c.orig	1994/03/11 22:32:57
--- man.c	1994/03/11 22:39:29
***************
*** 133,139 ****
  	if (!*argv)
  		usage();
  
! 	if (!f_cat && !f_how)
  		if (!isatty(1))
  			f_cat = 1;
  		else if ((pager = getenv("PAGER")) != NULL)
--- 133,139 ----
  	if (!*argv)
  		usage();
  
! 	if (!f_cat && !f_how && !f_where)
  		if (!isatty(1))
  			f_cat = 1;
  		else if ((pager = getenv("PAGER")) != NULL)

...keith
-- 
Keith White, Department of Computer Science, University of Ottawa
kwhite@csi.uottawa.ca [+1 613 564 5455]
>Audit-Trail:
>Unformatted:

------------------------------------------------------------------------------