Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: BUG: hrealloc() wants to realloc pushed memory
- X-seq: zsh-workers 12717
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: BUG: hrealloc() wants to realloc pushed memory
- Date: Tue, 29 Aug 2000 10:19:44 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Mon, 28 Aug 2000 14:52:44 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author