Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: repeat with negative count



I'm not completely sure about this one, but it feels wrong...

`repeat' with a negative count starts looping, different from the tcsh 
version of `repeat' which does nothing in such cases.

Should we make it return `1' in this case?

Bye
 Sven

diff -u oldsrc/loop.c Src/loop.c
--- oldsrc/loop.c	Fri Dec 17 21:37:50 1999
+++ Src/loop.c	Wed Dec 29 23:20:14 1999
@@ -357,7 +357,7 @@
     pushheap();
     cmdpush(CS_REPEAT);
     loops++;
-    while (count--) {
+    while (count-- > 0) {
 	execlist(cmd->u.list, 1, 0);
 	freeheap();
 	if (breaks) {

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author