summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/loop.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a5fce1d79..a00c539bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2016-01-27  Barton E. Schaefer  <schaefer@zsh.org>
 
+	* 37804 (plus error return per 37816): Src/loop.c: first word
+	following "repeat" should be evaluated as math, to match docs
+
 	* 37819: Src/hist.c: zshaddhistory hook is intended to work for
 	any history file write, even upon keyboard interrupt
 
diff --git a/Src/loop.c b/Src/loop.c
index 4def9b652..19d7f733e 100644
--- a/Src/loop.c
+++ b/Src/loop.c
@@ -493,7 +493,9 @@ execrepeat(Estate state, UNUSED(int do_exec))
     tmp = ecgetstr(state, EC_DUPTOK, &htok);
     if (htok)
 	singsub(&tmp);
-    count = atoi(tmp);
+    count = mathevali(tmp);
+    if (errflag)
+	return 1;
     pushheap();
     cmdpush(CS_REPEAT);
     loops++;