Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug Report: Variable becomes unset without reason
- X-seq: zsh-workers 44663
- From: Aryn Starr <whereislelouch@xxxxxxxxxx>
- To: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- Subject: Re: Bug Report: Variable becomes unset without reason
- Date: Wed, 14 Aug 2019 16:47:18 +0430
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1565785044; bh=+Re/u48VBE2aEdws3kxSyK4ZfSSsico0QeK3CH4Si2M=; h=Content-Type:Subject:From:Date:Message-Id:To; b=lB1aicDu9mCpg0IQghqyWs40wQZdln+V2yWLBJGVoF8ajmIaAggvs6IiVp5qwZb7l z+owfgtKAsIlBm5WyxVuUePbCdzZiA+ifmvxu3ewoYpcFqimyggv6R1B1TtTmaZmMz pm0XaDws5Pci0LDnsLf57dhVHiNJY1rrfc6oATiVKnFeYsEo+uVzcFQqzWt7LK5Sgf LKyBiDRNR+9rv+6KOnEc0dbIjsQ09N1entD5kiaM5syrq/INmSIFtkJr3XkOBvjC4q uTUON9ySA+cwvXWe79Qz2s4xDNxPhHgUWSNy9G2KUELmnx2ydlXf+vwsj9PSALKKax LCpnR/8NYabtQ==
- In-reply-to: <20190814093748.u3pkdzrixmtunnt7@chaz.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: <2154283D-97B8-436B-8CC5-40624C11F356@icloud.com> <20190814093748.u3pkdzrixmtunnt7@chaz.gmail.com>
I’ll keep that in mind. I’m very new to mailing lists, and I haven’t found any resource on properly using mailing lists, unfortunately.
And yes, if we use an external program (or even just `command true`), the bug won’t appear. Though it does with function calls, too:
zsh -c 'v=1; ff() command true ; f() { local v; v=2 ff; }; f; typeset -p v'
> On Aug 14, 2019, at 2:07 PM, Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
>
> 2019-08-08 20:38:05 +0430, Aryn Starr:
>> I have included the file that reproduces the bug with `zsh -f` and the result of running it in https://gist.github.com/NightMachinary/32689e786a3b7f5865a042d49b884b57 <https://gist.github.com/NightMachinary/32689e786a3b7f5865a042d49b884b57>.
>
> Please try and make sure your bug reports are self-contained.
> The zsh ML has been around for decades and along with its
> archives will probably be around for several more decades, but
> we can't tell much about github (that link may become invalid
> at any time).
>
> We should also not have to fire up a web browser to figure out
> what the bug is about.
>
> Now, that being said, as discussed on U&L it looks like a bug
> indeed and a shorter reproducer is:
>
> $ zsh -xc 'v=1; f() { local v; v=2 true; }; f; typeset -p v'
> +zsh:1> v=1
> +zsh:1> f
> +f:0> local v
> +f:0> v=2 +f:0> true
> +zsh:1> typeset -p v
> zsh:typeset:1: no such variable: v
>
> Most likely, that's the "v=2 true" (where "true" is a builtin) that ends up
> unsetting the "v" from the global scope.
>
> --
> Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author