From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4525 invoked by alias); 13 Dec 2013 09:26:47 -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: 32104 Received: (qmail 7352 invoked from network); 13 Dec 2013 09:26:41 -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,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Martin Vaeth Subject: Re: PATCH: Util/helpfiles failing on old-fashioned unix Date: Fri, 13 Dec 2013 09:08:04 +0000 (UTC) Message-ID: References: <20131123174827.249f9678@pws-pc.ntlworld.com> <131123114714.ZM18477@torch.brasslantern.com> <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> Reply-To: vaeth@mathematik.uni-wuerzburg.de X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lounge.imp.fu-berlin.de User-Agent: slrn/pre1.0.0-26 (Linux) pda@sdf.org wrote: > This pipeline looks like > it could have an undetected error where man fails, but colcrt doesn't. This is right, but I do not know a clean way how to solve this problem in the lack of PIPESTATUS in posix - using known posix tricks like piping error status to >&3 also has compatbility issues (IIRC on cygwin). 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. 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: > +unless( undef == open(MANPAGE, '-|', "man $manfile | colcrt -")) { > + ( undef == open(MANPAGE, '-|', "nroff -man $manfile | col -bx")) The second open is executed if (and only if) the first open *succeeeds*. This is certainly not intended. Moreover, a clean patch should somehow attempt all 4 possible combinations of the tools.