Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: dynamic named directories clobber $reply
- X-seq: zsh-workers 29461
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: dynamic named directories clobber $reply
- Date: Sat, 4 Jun 2011 23:34:15 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- 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=
- In-reply-to: <20110604222447.385a7abc@pws-pc.ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <BANLkTimQNrEJgK+4h2Pba-diNLL-hE+JjA@mail.gmail.com> <20110604222447.385a7abc@pws-pc.ntlworld.com>
On 4 June 2011 23:24, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Sat, 4 Jun 2011 14:24:14 +0200
> Mikael Magnusson <mikachu@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author