Bug 23258

Summary: -w and -W options break when output is not a tty
Product: [Retired] Red Hat Linux Reporter: Need Real Name <csw>
Component: manAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: low    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-03 23:58:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-01-03 23:58:07 UTC
The -w and -W options behave differently and produce different output when 
the stdout is a tty tty than when it is not, e.i. 

$ man -W info
/var/catman/local/cat3/info.3.gz
/usr/local/man/man3/info.3

$ man -W info | cat
/usr/local/man/man3/info.3

$ man -W info | more
/usr/local/man/man3/info.3


I haven't checked the source code, but I imagine that there is a test 
for 'isatty' early in the man program to determine whether or not to 
utilize the preformatted 'catman' pages.  This test should always be true 
when the -W or -w options are in effect, otherwise it is easy to miss the 
source of corrupted man pages.

Incidentally, the 'man' manpage mentions the ability redirect the output 
of -W but does not say anything about the fact that the output will be 
*different* than if you just let it go to a terminal.  I don't think the 
man page is incorrect for this oversight; I think the behavior is broken.

Comment 1 Bernhard Rosenkraenzer 2001-04-25 09:06:45 UTC
Fixed in 1.5i-1