about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-29 08:20:59 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-08-29 08:20:59 +0000
commitf4f38507e54ad19ea28395f977637bb3f014c9dc (patch)
tree716b03f3caf72a35a53ced65469d5a91c0e55bd8
parent84fd4cb6e6980ea2773039b996e486d48c69334b (diff)
downloadzsh-f4f38507e54ad19ea28395f977637bb3f014c9dc.tar.gz
zsh-f4f38507e54ad19ea28395f977637bb3f014c9dc.tar.xz
zsh-f4f38507e54ad19ea28395f977637bb3f014c9dc.zip
fix for unbalanced calls to {push,pop}heap in docomplete()/get_comp_string() (12717)
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/zle_tricky.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 95196f7a8..15fb5d7fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-29  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 12717: Src/Zle/zle_tricky.c: fix for unbalanced calls to
+ 	{push,pop}heap in docomplete()/get_comp_string()
+	
 2000-08-28  Bart Schaefer  <schaefer@zsh.org>
 
 	* 12716: Doc/Zsh/builtins.yo, Doc/Zsh/compctl.yo,
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 63978175d..f9ba965db 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -581,7 +581,8 @@ docomplete(int lst)
     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 @@ docomplete(int lst)
 	    strcpy((char *) line, ol);
 	    ll = strlen((char *) line);
 	    cs = ocs;
+	    popheap();
 	    unmetafy_line();
 	    zsfree(s);
 	    zsfree(qword);