Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parse error on autoload -X and a function with & in name
- X-seq: zsh-workers 44503
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Parse error on autoload -X and a function with & in name
- Date: Tue, 9 Jul 2019 01:51:57 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eeNPcysQ0cxri9z/CcGS0RidSjgQ7x/HrWa3Byaxq48=; b=RhIiiD86x1fa9fq6FS3h9eaWLTvXmAQQXClpchLZxUlzg4DdebtAKsubd5ufjeNn1n bSTv0nOY8US95KOUr8ssi9whUAd2XjSoDrDySsNYMWp6cIBEJKar41XRejzP7GI7RaL/ XiiVdwcE2BJqC4DitMpnkr0bvUqFokK7DnaaDzpfwi+3fxWb7Ybh118GTqjifR+LmUIt NNZ/tdiEDVRNYaet56Ork/ggevYB1QLzK/qkI0FIzP+RvfVsd/tZgR8Bg9a/2yc2g02k LpnaL9CAyRmPMOJXuQYLmI3IPypCJ/2ULnroiYmNzUWMSLcaKizJxT3X8PJUYqjbPljK qPuQ==
- In-reply-to: <CAH+w=7bxJWMWrYo3+tmrm3Ua6nyOyBQnqj87ToR7nr=BD7JMHw@mail.gmail.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>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAjWDNyMpXxpTN1sAPCUcHvAyNvcVmfbJhKunHkEtPAjA@mail.gmail.com> <CAKc7PVBFaqhP4KRKhzBY79PeKU0MEy5eDHi5NYTEbtfgT1HPSA@mail.gmail.com> <CAH+w=7bxJWMWrYo3+tmrm3Ua6nyOyBQnqj87ToR7nr=BD7JMHw@mail.gmail.com>
On Tue, 9 Jul 2019 at 00:12, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Try this (apologies if gmail line wraps the @@ heading):
>
> diff --git a/Src/builtin.c b/Src/builtin.c
> index 9b9e76c77..7db36c41b 100644
> --- a/Src/builtin.c
> +++ b/Src/builtin.c
> @@ -3029,7 +3029,7 @@ eval_autoload(Shfunc shf, char *name, Options
> ops, int func)
> }
> if (OPT_MINUS(ops,'X')) {
> char *fargv[3];
> - fargv[0] = name;
> + fargv[0] = quotestring(name, QT_SINGLE_OPTIONAL);
> fargv[1] = "\"$@\"";
> fargv[2] = 0;
> shf->funcdef = mkautofn(shf);
The patch works:
echo echo hello > '&abcd'
function \&abcd() {
autoload -X
}
\&abcd
hello
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author