From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27160 invoked by alias); 24 Oct 2013 16:04:02 -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: 31882 Received: (qmail 24289 invoked from network); 24 Oct 2013 16:03:56 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-b7ef66d00000795a-e8-526944e901a5 Date: Thu, 24 Oct 2013 17:03:52 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Strange function/pipestatus behavior, maybe a scope bug? Message-id: <20131024170352.053ead5f@pwslap01u.europe.root.pri> In-reply-to: <20131024164829.55842279@pwslap01u.europe.root.pri> References: <20131023092155.5ba8a54b@pwslap01u.europe.root.pri> <20131023221412.5cdecd76@pws-pc.ntlworld.com> <131023221548.ZM2352@torch.brasslantern.com> <20131024095713.44d2982e@pwslap01u.europe.root.pri> <20131024164829.55842279@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e/4Fd2XLplBBmf/8lkcbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujAtnTzAXtHFWLHvwm62B8TNbFyMnh4SAicTsDf/ZIWwxiQv3 1gPFuTiEBJYySryc9JgRwlnOJPHzy2KwKhYBVYkH5yE62AQMJaZums0IYosIiEucXXueBcQW FnCVOHtnJlicV8BeYvPTI0wgNqeAg8TFpsNgtpDALGaJTc94QWx+AX2Jq38/MUFcYS8x88oZ qF5BiR+T74HNZBbQkti8rYkVwpaX2LzmLfMERoFZSMpmISmbhaRsASPzKkbR1NLkguKk9Fwj veLE3OLSvHS95PzcTYyQIPy6g3HpMatDjAIcjEo8vB9fZQQJsSaWFVfmHmKU4GBWEuGdppcZ JMSbklhZlVqUH19UmpNafIiRiYNTqoFx9eWw2Z+f8CalXZk87b/QNncDU39X9zQlzivKsb8N Z32/3XXqxQkfmfLuN2dmPckMuKPiNknQ9Gvdt46qGSUacR/CNxp6lXhW7bheuvHEpsL9z6+b uxdGzdQQu6n21JPp996G6e5tbBmyvzNXctzkbHI/9mbF/SVXMs6+91iar2h/4WdQ+Q1FJZbi jERDLeai4kQANN0K4iACAAA= On Thu, 24 Oct 2013 16:48:29 +0100 Peter Stephenson wrote: > There is some bad interaction with completion, at least on my setup > (happens from a vanilla setup, too): > > % true | true | false > % print $pipest > 0 > > This doesn't seem to happen with hooks, so completion is failing to save > something it should. Hmm... does the following have any bad effects? If we're really only after the return value of the function, I don't think it should... diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 39d41bd..5c5628a 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -826,7 +826,6 @@ callcompfunc(char *s, char *fn) sfcontext = SFC_CWIDGET; NEWHEAPS(compheap) { LinkList largs = NULL; - int olv = lastval; if (*cfargs) { char **p = cfargs; @@ -836,9 +835,7 @@ callcompfunc(char *s, char *fn) while (*p) addlinknode(largs, dupstring(*p++)); } - doshfunc(shfunc, largs, 0); - cfret = lastval; - lastval = olv; + cfret = doshfunc(shfunc, largs, 1); } OLDHEAPS; sfcontext = osc; endparamscope(); pws