From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4183 invoked from network); 15 Sep 2006 16:16:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Sep 2006 16:16:52 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 59392 invoked from network); 15 Sep 2006 16:16:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Sep 2006 16:16:34 -0000 Received: (qmail 23408 invoked by alias); 15 Sep 2006 16:16:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22715 Received: (qmail 23396 invoked from network); 15 Sep 2006 16:16:30 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Sep 2006 16:16:30 -0000 Received: (qmail 59087 invoked from network); 15 Sep 2006 16:16:30 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 15 Sep 2006 16:16:25 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly31d.srv.mailcontrol.com (MailControl) with ESMTP id k8FG7iIm001858 for ; Fri, 15 Sep 2006 17:16:00 +0100 Received: from cameurexb01.EUROPE.ROOT.PRI ([10.100.137.61]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 15 Sep 2006 17:11:57 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 15 Sep 2006 17:11:57 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k8FGBu98020729 for ; Fri, 15 Sep 2006 17:11:56 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k8FGBubZ020726 for ; Fri, 15 Sep 2006 17:11:56 +0100 Message-Id: <200609151611.k8FGBubZ020726@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: setopt autocontinue doesn't work In-reply-to: <20060914231205.GA10768@localhost.localdomain> References: <20060914231205.GA10768@localhost.localdomain> Date: Fri, 15 Sep 2006 17:11:56 +0100 From: Peter Stephenson X-OriginalArrivalTime: 15 Sep 2006 16:11:57.0462 (UTC) FILETIME=[AAFD8360:01C6D8E1] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-04-02 (www.mailcontrol.com) on 10.68.0.141 > setopt autocontinue doesn't work Weird... this has apparently been the case since the option was introduced in 2001 and no one has noticed. Without rewriting the code entirely, the following is the simplest fix. Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.102 diff -u -r1.102 exec.c --- Src/exec.c 16 Jun 2006 10:44:04 -0000 1.102 +++ Src/exec.c 15 Sep 2006 16:09:05 -0000 @@ -1838,7 +1838,7 @@ int nullexec = 0, assign = 0, forked = 0; int is_shfunc = 0, is_builtin = 0, is_exec = 0, use_defpath = 0; /* Various flags to the command. */ - int cflags = 0, checked = 0, oautocont = opts[AUTOCONTINUE]; + int cflags = 0, checked = 0, oautocont = -1; LinkList redir; wordcode code; Wordcode beg = state->pc, varspc; @@ -1873,8 +1873,10 @@ * reference to a job in the job table. */ if (type == WC_SIMPLE && args && nonempty(args) && *(char *)peekfirst(args) == '%') { - if (how & Z_DISOWN) + if (how & Z_DISOWN) { + oautocont = opts[AUTOCONTINUE]; opts[AUTOCONTINUE] = 1; + } pushnode(args, dupstring((how & Z_DISOWN) ? "disown" : (how & Z_ASYNC) ? "bg" : "fg")); how = Z_SYNC; @@ -2060,7 +2062,8 @@ if (cflags & BINF_BUILTIN) { zwarn("no such builtin: %s", cmdarg); lastval = 1; - opts[AUTOCONTINUE] = oautocont; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; return; } break; @@ -2084,7 +2087,8 @@ if (errflag) { lastval = 1; - opts[AUTOCONTINUE] = oautocont; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; return; } @@ -2128,7 +2132,8 @@ if (errflag) { lastval = 1; - opts[AUTOCONTINUE] = oautocont; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; return; } @@ -2212,7 +2217,8 @@ if ((pid = zfork(&bgtime)) == -1) { close(synch[0]); close(synch[1]); - opts[AUTOCONTINUE] = oautocont; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; return; } if (pid) { close(synch[1]); @@ -2238,7 +2244,8 @@ } } addproc(pid, text, 0, &bgtime); - opts[AUTOCONTINUE] = oautocont; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; return; } /* pid == 0 */ @@ -2676,7 +2683,8 @@ zsfree(STTYval); STTYval = 0; - opts[AUTOCONTINUE] = oautocont; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; } /* Arrange to have variables restored. */ -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php