From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 911 invoked by alias); 12 Sep 2011 16:19:01 -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: 29769 Received: (qmail 1810 invoked from network); 12 Sep 2011 16:19:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) 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 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110912091855.ZM13053@torch.brasslantern.com> Date: Mon, 12 Sep 2011 09:18:55 -0700 In-reply-to: <110912090353.ZM13021@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: How to misplace an entire pipeline" (Sep 12, 9:03am) References: <110805203111.ZM32508@torch.brasslantern.com> <20110807185002.6a042cab@pws-pc.ntlworld.com> <110807144359.ZM27903@torch.brasslantern.com> <110807210507.ZM28821@torch.brasslantern.com> <20110808192720.380a3ee7@pws-pc.ntlworld.com> <110808231032.ZM2380@torch.brasslantern.com> <20110809211910.631d6561@pws-pc.ntlworld.com> <110813115208.ZM20513@torch.brasslantern.com> <20110912135123.GA12110@altlinux.org> <110912090353.ZM13021@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: How to misplace an entire pipeline MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 12, 9:03am, Bart Schaefer wrote: } } If I understand correctly, thisjob == -1 means there is no foreground } job. I'm scratching my head over how list_pipe can be true when there } is no job in the foreground. In particular I can't decide whether the fix is to do this: 494c494,496 < (list_pipe && (jobtab[thisjob].stat & STAT_BUILTIN))) && --- > (list_pipe && > (thisjob == -1 || > (jobtab[thisjob].stat & STAT_BUILTIN)))) && Or this: 494c494,496 < (list_pipe && (jobtab[thisjob].stat & STAT_BUILTIN))) && --- > (list_pipe && > (thisjob != -1 && > (jobtab[thisjob].stat & STAT_BUILTIN)))) && The first way treats no-foreground-job as if a shell builtin were in the foreground. The second way treats no-foreground-job as if an external command were in the foreground. I tend to think the former is the way to go here -- if there's no job in the foreground, then the parent shell must be in the foreground, and hence nothing is prepared to restart the signalled job if it gets stopped. However, I'm not that confident that I know all the cases where thisjob == -1 may be true. Any help here? If not we're going with plan (A).