From: Bernd Eggink <eggink@uni-hamburg.de>
To: Zsh-workers <zsh-workers@math.gatech.edu>
Subject: Bug in select
Date: Wed, 01 Jul 1998 20:21:45 +0200 [thread overview]
Message-ID: <359A7E39.1ACBAC8A@uni-hamburg.de> (raw)
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@uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html
next reply other threads:[~1998-07-01 18:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-07-01 18:21 Bernd Eggink [this message]
1998-07-03 16:15 ` PATCH: " Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
1996-12-29 3:28 bug " Yamamoto Hirotaka
1996-12-29 23:15 ` Zoltan Hidvegi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=359A7E39.1ACBAC8A@uni-hamburg.de \
--to=eggink@uni-hamburg.de \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).