From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17340 invoked from network); 8 Jul 2001 00:07:25 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jul 2001 00:07:25 -0000 Received: (qmail 16119 invoked by alias); 8 Jul 2001 00:06:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15308 Received: (qmail 16108 invoked from network); 8 Jul 2001 00:06:19 -0000 From: "Bart Schaefer" Message-Id: <1010708000549.ZM17484@candle.brasslantern.com> Date: Sun, 8 Jul 2001 00:05:48 +0000 In-Reply-To: <1010707231600.ZM16868@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "4.0.1 (and 4.1.0) infinite loop with history" (Jul 7, 11:15pm) References: <1010707231600.ZM16868@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: PATCH: Re: 4.0.1 (and 4.1.0) infinite loop with history MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 7, 11:15pm, Bart Schaefer wrote: } Subject: 4.0.1 (and 4.1.0) infinite loop with history } } ... all you need to do is fill up the history (so that event } number 1 will fall off the saved lines) and then give the command `r = 1'. Happens in 3.0.6 through 3.0.8 as well. And -- good grief -- even in 2.4. And the history number is a red herring: The loop appears to be attempting to globally replace the empty string with the empty string, i.e. the `=' is being taken as a degenerate case of OLD=NEW. Consequently, this should fix it: Index: Src/builtin.c =================================================================== diff -c -r1.4 Src/builtin.c --- Src/builtin.c 2001/06/18 18:01:56 1.4 +++ Src/builtin.c 2001/07/08 00:02:51 @@ -1250,6 +1250,10 @@ while (*argv && equalsplit(*argv, &s)) { Asgment a = (Asgment) zhalloc(sizeof *a); + if (!**argv) { + zwarnnam(nam, "invalid replacement pattern: =%s", s, 0); + return 1; + } if (!asgf) asgf = asgl = a; else { -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net