From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28990 invoked from network); 3 Jul 1998 16:23:04 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 3 Jul 1998 16:23:04 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id MAA22130; Fri, 3 Jul 1998 12:13:38 -0400 (EDT) Resent-Date: Fri, 3 Jul 1998 12:13:38 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980703091502.ZM23172@candle.brasslantern.com> Date: Fri, 3 Jul 1998 09:15:02 -0700 In-Reply-To: <359A7E39.1ACBAC8A@uni-hamburg.de> Comments: In reply to Bernd Eggink "Bug in select" (Jul 1, 8:21pm) References: <359A7E39.1ACBAC8A@uni-hamburg.de> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Zsh-workers Subject: PATCH: Re: Bug in select MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"fT6Q-3.0.jP5.nCGdr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4200 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 1, 8:21pm, Bernd Eggink wrote: } Subject: Bug in select } } Zsh-3.1.4 has a bug in 'select': An empty user input is not treated } correctly, due to a misconstructed do-loop I couldn't get this patch to apply, probably because some mailer along the way munged the whitespace. Here it is again, with indentation cleaned up (was Bernd's patch made with "diff -bw ..."?). Index: Src/loop.c =================================================================== RCS file: /extra/cvsroot/zsh/zsh-3.1/Src/loop.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 loop.c --- loop.c 1998/06/01 17:08:44 1.1.1.1 +++ loop.c 1998/07/03 16:11:36 @@ -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) { - selectlist(args); - continue; - } - } while(0); + if (*str) + break; + selectlist(args); + }; setsparam("REPLY", ztrdup(str)); i = atoi(str); if (!i) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com