From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28375 invoked from network); 29 Aug 2000 08:20:32 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Aug 2000 08:20:32 -0000 Received: (qmail 22423 invoked by alias); 29 Aug 2000 08:19:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12717 Received: (qmail 22416 invoked from network); 29 Aug 2000 08:19:52 -0000 Date: Tue, 29 Aug 2000 10:19:44 +0200 (MET DST) Message-Id: <200008290819.KAA16469@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 28 Aug 2000 14:52:44 +0000 Subject: PATCH: Re: BUG: hrealloc() wants to realloc pushed memory 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