Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: repeat with negative count
- X-seq: zsh-workers 9188
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: repeat with negative count
- Date: Tue, 4 Jan 2000 09:06:36 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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