zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Adam Spiers <adam@spiers.net>
Cc: zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: Re: vanishing history
Date: Mon, 18 Feb 2002 11:31:17 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.33L2.0202181125350.15972-100000@phong.blorf.net> (raw)
In-Reply-To: <20020218181021.A27877@corelli.new.ox.ac.uk>

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---


      parent reply	other threads:[~2002-02-18 19:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20011128161905.A9726@corelli.new.ox.ac.uk>
     [not found] ` <Pine.LNX.4.33L2.0202160123440.1473-100000@phong.blorf.net>
2002-02-18 18:10   ` Adam Spiers
2002-02-18 18:15     ` Adam Spiers
2002-02-18 19:31     ` Wayne Davison [this message]

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=Pine.LNX.4.33L2.0202181125350.15972-100000@phong.blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=adam@spiers.net \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).