From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26205 invoked by alias); 15 Dec 2013 23:38:09 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32120 Received: (qmail 6191 invoked from network); 15 Dec 2013 23:38:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 From: pda@sdf.org Date: Sun, 15 Dec 2013 23:37:53 +0000 To: zsh-workers@zsh.org Subject: Re: PATCH: Util/helpfiles failing on old-fashioned unix Message-ID: <20131215233752.GA3644@ma.sdf.org> Mail-Followup-To: zsh-workers@zsh.org References: <131123210612.ZM31978@torch.brasslantern.com> <20131124175649.27c2559a@pws!> <-pc.ntlworld.com@samsung.com> <131125001818.ZM26494@torch.brasslantern.com> <691AC9C6-D832-42FC-B983-60C682AA5515@kba.biglobe.ne.jp> <20131125154954.14283de2@pwslap01u.europe.root.pri> <131125085631.ZM17483@torch.brasslantern.com> <20131212221744.GA27563@ma.sdf.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22+4 (84acf5f0ce92) (2013-10-16) On Fri, Dec 13, 2013 at 09:08:04AM +0000, Martin Vaeth wrote: > pda@sdf.org 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.