From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6891 invoked by alias); 4 Jun 2011 21:34:32 -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: 29461 Received: (qmail 6532 invoked from network); 4 Jun 2011 21:34:21 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ih2Z5rg/999H/bh96dVgv69/0E39A/XyuCYbYV3wt4g=; b=hTLUV9tee4a3xkajrK4wLtH6Akz2/6Hb/DvdCRIAmqN7PIJyjXY4FQ6w+oL9JNCGq8 DLUulZj6bMlipqocDJq3vK1AW7DBKiWHWtPvOZaHcw1rcXkCdVr10A3qbaxduML4odvi JImGk9zIfp6eQQeeJWAoVF/nx2lq7kRY8XHEM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Mp1+pd+rI1uX7bVvpIBpM7GJXlucrTgHXRnImk0Fsj4+cOX9He81gLUwyjKK3G5rF2 c0EPvCPMi54rvwtZUTLUjYSv16JsddfC7J13u9bMBgVPds5nbyuRNj45vWtNRI/eMx/5 AIl7991cQQsQ3yG0cyPFCijLig06q1v6DRonc= MIME-Version: 1.0 In-Reply-To: <20110604222447.385a7abc@pws-pc.ntlworld.com> References: <20110604222447.385a7abc@pws-pc.ntlworld.com> Date: Sat, 4 Jun 2011 23:34:15 +0200 Message-ID: Subject: Re: dynamic named directories clobber $reply From: Mikael Magnusson To: Peter Stephenson Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 4 June 2011 23:24, Peter Stephenson wrote: > On Sat, 4 Jun 2011 14:24:14 +0200 > Mikael Magnusson wrote: >> I noticed that after a successful ~[something] substitution, ~[] or >> ~[invalid] would return the same substitution, because $reply leaks to >> the parent shell, and my function doesn't unset $reply when it doesn't >> find anything valid. > > In addition to Bart's reply, this would only be an actual bug if it was > happening when your function returned non-zero, which is what it's supposed to > do if it doesn't have a match. Yeah, it turned out I forgot to return 1 on failure in my function. I was worried about the hooks not having any way to unset reply so they wouldn't clobber eachothers' results, but then I realized I was confusing it with the completion case where they all get to add stuff. In the n case though, as soon as one hook returns true no more hooks are called so it should be fine. -- Mikael Magnusson