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

Re: PATCH: Util/helpfiles failing on old-fashioned unix

On Fri, Dec 13, 2013 at 09:08:04AM +0000, Martin Vaeth wrote:
> pda@xxxxxxx <pda@xxxxxxx> wrote:
> A natural way is to start the man/nroff and colcrt/col processes
> separately. Unfortunately, I do not know a way in perl to redirect
> stdin *and* stdout of a subprocess simultaneously.
> Perhaps the only clean way is to use a temporary file first for the
> man/nroff output and then for the colcrc/col output.

Yes... although I wasn't really proposing to go to that much trouble,
since this scenario seems uncommon enough not to be worth it.  I see
you've gone ahead and done that, so kudos.

> Anyway, your patch only breaks usage on other systems:
> The semantics of your patch is just a changed second open call and
> that the error status of the first call to open is negated which
> is certainly not intended:

D'oh!  That was certainly poorly tested.  It kind of worked for me,
without me fully understanding why at the time.  Looking more closely
at how perl opens a pipe, I see it seems to always succeed, even when
the pipe components fail.  Looks like testing for emptiness of the
file handle would do the trick.

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