groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Displaying man pages on Win32


From: MARSHALL Keith
Subject: [Groff] Displaying man pages on Win32
Date: Thu, 3 Jun 2004 10:32:27 +0100

Hi All,

I just completed a quick and dirty port of man-1.5m2, to
run on native Win32, using groff-1.19.1 as the formatter,
with the less implementation shipped with MSYS as the pager,
and the Bourne shell from the same source to run man's
formatting and display pipeline.

It works a treat, except for one minor niggle -- when
reading any comparatively large man page (groff.1 is big
enough), and I quit from less without reading to the end,
then grotty complains ...

   grotty:<standard input>
     (<standard input>):9064:fatal error: output error

... (the reported line number varies, depending on the man
page being read, and how far into the page I read).

I am fairly certain that this is due to Win32's lack of
SIGPIPE handling, so that less has no way to tell grotty
that it is exiting, without swallowing all of grotty's
output -- effectively the same problem we recently fixed
in gtroff itself, when formatting only a limited page range
from a preprocessed input stream.  In this case, of course,
the source of the problem lies outside the scope of groff;
to properly fix it would require that *every* possible pager
that might be used should be modified, to ensure that all
available input is swallowed, even on premature termination.
This is surely an impractical proposition.

A quick and dirty work around is to configure man, such that
*all* stderr output from the formatter is redirected to NUL,
(which is Win32's native name for /dev/null); however this
does suffer from the drawback that *all* error output from
groff/grotty will be discarded, and not just this one message
which we would like to avoid.

What do you think of the idea of adding an option to grotty,
perhaps specific to the Win32 build, which would cause it to
silently clean up and exit, when this specific I/O error is
encountered?

Best regards,
Keith.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]