Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Util/helpfiles failing on old-fashioned unix



I may be the only one generating documentation on a system without colcrt,
so this isn't too important in the grand scheme of things.  The first
line I've changed has three things wrong with it on HP-UX -- no colcrt
here, man can't be used with ./manfile.1, but most importantly the check
of perl's open doesn't seem right for a pipe.  This pipeline looks like
it could have an undetected error where man fails, but colcrt doesn't.

My perl-fu isn't the strongest, so this could very well do with further
tweaking... was there any reason for the close I removed?


--- a/Util/helpfiles
+++ b/Util/helpfiles
@@ -65,13 +65,12 @@ $ENV{'LANG'} = 'C';
 $ENV{'MANWIDTH'} = '80';
 $ENV{'GROFF_NO_SGR'} = ''; # We need "classical" formatting of man pages.
 
-unless(open(MANPAGE, '-|', "man $manfile | colcrt -")) {
-    close(MANPAGE);
-    open(MANPAGE, '-|', "man $manfile | col -bx")
+unless( undef == open(MANPAGE, '-|', "man $manfile | colcrt -")) {
+      ( undef == open(MANPAGE, '-|', "nroff -man $manfile | col -bx"))
 # The x is necessary so that spaces don't turn into tabs, which messes
 # up the calculations of indentation on machines which randomly wrap lines
 # round to the previous line (so you see what we're up against).
-     || &Die('can run neither "man | colcrt -" nor "man | col -bx"');
+        && &Die('can run neither "man | colcrt -" nor "nroff -man | col -bx"');
 }
 
 unless($linkfile eq '') {



Messages sorted by: Reverse Date, Date, Thread, Author