zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: BUG: hrealloc() wants to realloc pushed memory
Date: Tue, 29 Aug 2000 10:19:44 +0200 (MET DST)	[thread overview]
Message-ID: <200008290819.KAA16469@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 28 Aug 2000 14:52:44 +0000


Bart Schaefer wrote:

> The zstyle command from zsh-users/3404 produces the error.  It may have
> something to do with invoking completion at the PS2 prompts -- I see it
> when cut'n'pasting lines with leading tabs like this:
> 
> zstyle -e ':completion:*:ssh:*' hosts \
> 	'reply=($(sed -e "/^#/d" -e "s/ .*\$//" -e "s/,/ /g" \
> 		/etc/ssh_known_hosts ~/.ssh/known_hosts 2>/dev/null))'

Whoa. That's a very old bug. get_comp_string() pushes a heap, but
doesn't pop it, that has to be done in docomplete(). And that didn't
do it when inside a string that begins in the chline string (the stuff 
on previous lines in a multi-line buffer, the part we can't edit).

Bye
 Sven

Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.19
diff -u -r1.19 zle_tricky.c
--- Src/Zle/zle_tricky.c	2000/08/11 12:19:35	1.19
+++ Src/Zle/zle_tricky.c	2000/08/29 08:19:13
@@ -581,7 +581,8 @@
     qisuf = ztrdup("");
     zsfree(autoq);
     autoq = NULL;
-    /* Get the word to complete. */
+    /* Get the word to complete.
+     * NOTE: get_comp_string() calls pushheap(), but not popheap(). */
     noerrs = 1;
     s = get_comp_string();
     DPUTS(wb < 0 || cs < wb || cs > we,
@@ -603,6 +604,7 @@
 	    strcpy((char *) line, ol);
 	    ll = strlen((char *) line);
 	    cs = ocs;
+	    popheap();
 	    unmetafy_line();
 	    zsfree(s);
 	    zsfree(qword);

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-08-29  8:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200008290819.KAA16469@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --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).