From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id c7135921 for ; Wed, 14 Aug 2019 12:18:08 +0000 (UTC) Received: (qmail 11310 invoked by alias); 14 Aug 2019 12:18:01 -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: List-Unsubscribe: X-Seq: 44663 Received: (qmail 23225 invoked by uid 1010); 14 Aug 2019 12:18:01 -0000 X-Qmail-Scanner-Diagnostics: from st43p00im-ztfb10071701.me.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25538. spamassassin: 3.4.2. Clear:RC:0(17.58.63.173):SA:0(-4.3/5.0):. Processed in 1.91877 secs); 14 Aug 2019 12:18:01 -0000 X-Envelope-From: whereislelouch@icloud.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at icloud.com designates 17.58.63.173 as permitted sender) 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== Content-Type: multipart/alternative; boundary=Apple-Mail-BE2752A1-E10E-42E7-88B9-8786F87F934B Mime-Version: 1.0 (1.0) Subject: Re: Bug Report: Variable becomes unset without reason From: Aryn Starr X-Mailer: iPhone Mail (16B92) In-Reply-To: <20190814093748.u3pkdzrixmtunnt7@chaz.gmail.com> Date: Wed, 14 Aug 2019 16:47:18 +0430 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: 7bit Message-Id: <46AE5CBB-5453-4481-801F-6681FA33520D@icloud.com> References: <2154283D-97B8-436B-8CC5-40624C11F356@icloud.com> <20190814093748.u3pkdzrixmtunnt7@chaz.gmail.com> To: Stephane Chazelas X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-14_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=817 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1908140128 --Apple-Mail-BE2752A1-E10E-42E7-88B9-8786F87F934B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I=E2=80=99ll keep that in mind. I=E2=80=99m very new to mailing lists, and I= haven=E2=80=99t found any resource on properly using mailing lists, unfortu= nately.=20 And yes, if we use an external program (or even just `command true`), the bu= g won=E2=80=99t appear. Though it does with function calls, too: zsh -c 'v=3D1; ff() command true ; f() { local v; v=3D2 ff; }; f; typeset -p= v' > On Aug 14, 2019, at 2:07 PM, Stephane Chazelas wrote: >=20 > 2019-08-08 20:38:05 +0430, Aryn Starr: >> I have included the file that reproduces the bug with `zsh -f` and the re= sult of running it in https://gist.github.com/NightMachinary/32689e786a3b7f5= 865a042d49b884b57 .=20 >=20 > 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). >=20 > We should also not have to fire up a web browser to figure out > what the bug is about. >=20 > Now, that being said, as discussed on U&L it looks like a bug > indeed and a shorter reproducer is: >=20 > $ zsh -xc 'v=3D1; f() { local v; v=3D2 true; }; f; typeset -p v' > +zsh:1> v=3D1 > +zsh:1> f > +f:0> local v > +f:0> v=3D2 +f:0> true > +zsh:1> typeset -p v > zsh:typeset:1: no such variable: v >=20 > Most likely, that's the "v=3D2 true" (where "true" is a builtin) that ends= up > unsetting the "v" from the global scope. >=20 > --=20 > Stephane --Apple-Mail-BE2752A1-E10E-42E7-88B9-8786F87F934B--