Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug in select
- X-seq: zsh-workers 4192
- From: Bernd Eggink <eggink@xxxxxxxxxxxxxx>
- To: Zsh-workers <zsh-workers@xxxxxxxxxxxxxxx>
- Subject: Bug in select
- Date: Wed, 01 Jul 1998 20:21:45 +0200
- Organization: Regionales Rechenzentrum der Uni Hamburg
- Sender: rz2a022@xxxxxxxxxxxxxx
Zsh-3.1.4 has a bug in 'select': An empty user input is not treated
correctly, due to a misconstructed do-loop (in do ... while(0) break and
continue have the same effect).
Here is a patch:
--- loop.c.old Wed Jul 1 19:19:26 1998
+++ loop.c Wed Jul 1 19:28:28 1998
@@ -156,7 +156,7 @@
inp = fdopen(dup((SHTTY == -1) ? 0 : SHTTY), "r");
selectlist(args);
for (;;) {
- do {
+ for (;;) {
if (empty(bufstack)) {
if (interact && SHTTY != -1 && isset(USEZLE))
str = (char *)zleread(prompt3, NULL, 0);
@@ -178,11 +178,10 @@
}
if ((s = strchr(str, '\n')))
*s = '\0';
- if(!*str) {
+ if(*str)
+ break;
selectlist(args);
- continue;
- }
- } while(0);
+ };
setsparam("REPLY", ztrdup(str));
i = atoi(str);
if (!i)
--
Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg
eggink@xxxxxxxxxxxxxx
http://www.rrz.uni-hamburg.de/eggink/BEggink.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author