From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9500 invoked from network); 18 Feb 2002 19:31:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Feb 2002 19:31:54 -0000 Received: (qmail 5186 invoked by alias); 18 Feb 2002 19:31:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16672 Received: (qmail 5175 invoked from network); 18 Feb 2002 19:31:46 -0000 Date: Mon, 18 Feb 2002 11:31:17 -0800 (PST) From: Wayne Davison X-X-Sender: To: Adam Spiers Cc: zsh workers mailing list Subject: Re: vanishing history In-Reply-To: <20020218181021.A27877@corelli.new.ox.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 18 Feb 2002, Adam Spiers wrote: > this patch (or at least, the combination of all cvs commits over the > last few weeks) makes zsh core dump when I try that way, which is to > simply type ^X?, which is bound to _complete_debug. This is because of a bug in my recent changes in prepnexthistent(). I've just checked in a fix for this. My history doesn't vanish running this, so if you can still duplicate the vanishing-history problem, let me know. ..wayne.. ---8<------8<------8<------8<---cut here--->8------>8------>8------>8--- Index: Src/hist.c --- Src/hist.c 16 Feb 2002 09:21:34 -0000 1.40 +++ Src/hist.c 18 Feb 2002 19:24:34 -0000 @@ -947,6 +947,7 @@ Histent prepnexthistent(void) { + Histent he; int curline_in_ring = hist_ring == &curline; if (curline_in_ring) @@ -957,7 +958,7 @@ } if (histlinect < histsiz) { - Histent he = (Histent)zcalloc(sizeof *he); + he = (Histent)zcalloc(sizeof *he); if (!hist_ring) hist_ring = he->up = he->down = he; else { @@ -970,12 +971,12 @@ } else { putoldhistentryontop(0); - freehistdata(hist_ring, 0); + freehistdata(he = hist_ring, 0); } - hist_ring->histnum = ++curhist; + he->histnum = ++curhist; if (curline_in_ring) linkcurline(); - return hist_ring; + return he; } /* A helper function for hend() */ ---8<------8<------8<------8<---cut here--->8------>8------>8------>8---