zsh-users
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Simon Chatterjee" <jal@chatts.net>
Cc: "Zsh Users" <zsh-users@zsh.org>,
	"Roman Perepelitsa" <roman.perepelitsa@gmail.com>
Subject: Re: Possible bug in 5.8
Date: Mon, 20 Dec 2021 18:23:03 +0000	[thread overview]
Message-ID: <d6ef0c08-b97a-4c01-8fd7-6689800b59e4@www.fastmail.com> (raw)
In-Reply-To: <CAN=4vMruW3wh0dwN8yPAUiZ8Mzki9Lj98-_6mKmvNMuX9N9ELg@mail.gmail.com>

Roman Perepelitsa wrote on Mon, 20 Dec 2021 13:28 +00:00:
> On Mon, Dec 20, 2021 at 2:18 PM Simon Chatterjee <jal@chatts.net> wrote:
>>
>> Zsh 5.8 seems to have a problem with the variable ‘i’, in a ‘for … in’
>> loop, where an item being iterated over starts with a ‘/‘:
>>
>> % zsh --version
>> zsh 5.8 (x86_64-pc-linux-gnu)
>> % for p in /; do echo $p; done
>> /
>> % for i in /; do echo $i; done
>> zsh: bad math expression: operand expected at `/‘
>
> Works fine for me:
>
>   % docker run --rm zshusers/zsh:5.8 zsh -c 'for i in /; do echo $i; done'
>   /
>
> Try reproducing this from `zsh -f`. If you cannot, run `typeset -p i`
> in your shell. You'll probably see that it's defined. Since `zsh -f`
> doesn't have this parameter, it must be defined in rc files.

So, run «zsh -x» and look for «i» in the trace output (as a whole word).

You could try your luck with «zsh -o WARN_CREATE_GLOBAL».  It won't help
if someone _deliberately_ made «i» global, but it would catch implicit
creations of a global integer parameter (e.g., in arithmetic contexts).

The way to report bug is to post them to this list.


  reply	other threads:[~2021-12-20 18:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 13:17 Simon Chatterjee
2021-12-20 13:26 ` Dominik Vogt
2021-12-20 13:28 ` Roman Perepelitsa
2021-12-20 18:23   ` Daniel Shahaf [this message]
     [not found]   ` <CABA_rhDUsQCr5AfsWSiktjncjjzwd=eTb=OYhyC7p_RHvSxOgA@mail.gmail.com>
2021-12-20 18:26     ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6ef0c08-b97a-4c01-8fd7-6689800b59e4@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=jal@chatts.net \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).