From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: globbing in the repeat-count word gives "illegal character"
Date: Wed, 25 Mar 2020 21:09:28 +0000 [thread overview]
Message-ID: <07c8c283193808eb50a4a79b8dc68b56cffe223d.camel@ntlworld.com> (raw)
In-Reply-To: <CAHYJk3QDYrb5z9rh7D3y9cDJY3_Gs424chsTpWLP0qZyk9sL+g@mail.gmail.com>
This is straightforward. There is no reason to propagate tokens.
diff --git a/Src/loop.c b/Src/loop.c
index 95ef48b33..f13c8c4a9 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -499,8 +499,10 @@ execrepeat(Estate state, UNUSED(int do_exec))
lastval = 0;
tmp = ecgetstr(state, EC_DUPTOK, &htok);
- if (htok)
+ if (htok) {
singsub(&tmp);
+ untokenize(tmp);
+ }
count = mathevali(tmp);
if (errflag)
return 1;
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 0dbf468f6..cefa1c974 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -557,6 +557,14 @@
>Hip hip hooray
>Hip hip hooray
+ (setopt nonomatch
+ repeat 2*2 print yeah)
+0:Tokens in repeat argument
+>yeah
+>yeah
+>yeah
+>yeah
+
case bravo {
(alpha) print schmalpha
;;
next prev parent reply other threads:[~2020-03-25 21:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 3:29 Daniel Shahaf
2020-03-17 18:37 ` Mikael Magnusson
2020-03-23 5:31 ` Daniel Shahaf
2020-03-23 6:53 ` Mikael Magnusson
2020-03-25 21:09 ` Peter Stephenson [this message]
[not found] ` <20200325234655.786e8a88@tarpaulin.shahaf.local2>
2020-03-26 20:58 ` Peter Stephenson
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=07c8c283193808eb50a4a79b8dc68b56cffe223d.camel@ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@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).