From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2693 invoked from network); 14 Oct 2001 21:56:26 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Oct 2001 21:56:26 -0000 Received: (qmail 22426 invoked by alias); 14 Oct 2001 21:56:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16038 Received: (qmail 22413 invoked from network); 14 Oct 2001 21:56:16 -0000 From: Bart Schaefer Message-Id: <1011014215607.ZM6899@candle.brasslantern.com> Date: Sun, 14 Oct 2001 21:56:07 +0000 In-Reply-To: <1011012050227.ZM19535@candle.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Very odd behaviour with zsh, maybe corruption bug" (Oct 12, 5:02am) References: <1011012050227.ZM19535@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: martin.ebourne@arcordia.com, zsh-workers@sunsite.dk Subject: PATCH: Re: Very odd behaviour with zsh, maybe corruption bug MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 12, 5:02am, Bart Schaefer wrote: } } This *must* be a bug in prefork() called via singsub(); it must be zeroing } `right' (and thus also zeroing `opat') before copying the string. But I } just can't seem to catch it happening. Having traced through this more closely, which was rather laborious, I have come to the conclusion that the bug is right there in evalcond(), and that the following is the fix. At least, I can't see how this patch could possibly cause -incorrect- behavior, though it might result in an optimization being skipped unnecessarily in some cases. Sven, please dispute this if you can. Index: Src/cond.c =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/cond.c,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 cond.c --- Src/cond.c 2001/04/09 20:14:12 1.1.1.1 +++ Src/cond.c 2001/10/14 21:48:55 @@ -202,7 +202,7 @@ char *opat; int save; - right = opat = dupstring(ecrawstr(state->prog, state->pc, + right = dupstring(opat = ecrawstr(state->prog, state->pc, &htok)); if (htok) singsub(&right); -- 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