* PATCH: Re: BUG: hrealloc() wants to realloc pushed memory
@ 2000-08-29 8:19 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-08-29 8:19 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-08-29 8:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-29 8:19 PATCH: Re: BUG: hrealloc() wants to realloc pushed memory Sven Wischnowsky
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).