about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2020-03-26 20:54:37 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2020-03-26 20:54:37 +0000
commit2a9674862ecaf9b7b1b66178782d47e8445df325 (patch)
tree69b2003060115d100225ed5b93e772c78e5d8dfa
parentfc286a7c11aa767cab203f1fe111133eac9056fa (diff)
downloadzsh-2a9674862ecaf9b7b1b66178782d47e8445df325.tar.gz
zsh-2a9674862ecaf9b7b1b66178782d47e8445df325.tar.xz
zsh-2a9674862ecaf9b7b1b66178782d47e8445df325.zip
45616: Remove token from count argument to repeat
-rw-r--r--ChangeLog5
-rw-r--r--Src/loop.c4
-rw-r--r--Test/A01grammar.ztst7
3 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fea7b0f76..0f4c36dfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-26  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 45616: Src/loop.c, Test/A01grammar.ztst: Remove tokens
+	from count to repeat keyword.
+
 2020-03-25  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 45583/0008: Etc/BUGS, Src/utils.c, Test/B13whence.ztst:
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..35a04e7d5 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -557,6 +557,13 @@
 >Hip hip hooray
 >Hip hip hooray
 
+  repeat 2*2 print yeah
+0:Tokens in repeat argument
+>yeah
+>yeah
+>yeah
+>yeah
+
   case bravo {
     (alpha) print schmalpha
 	    ;;