about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/complist.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index bc3b90c50..761a758df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-28  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 24627: Src/Zsh/complist.c: fix(?) crash when resizing window
+	during menu-select.
+
 2008-02-28  Clint Adams  <clint@zsh.org>
 
 	* 24626: Completion/Unix/Type/_path_commands, Doc/Zsh/compsys.yo:
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 97b55b609..0daef7941 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -122,7 +122,11 @@ static struct listcols mcolors;
 int mgtabsize;
 #endif
 
-/* Used in mtab/mgtab, for explanations. */
+/*
+ * Used in mtab/mgtab, for explanations.
+ *
+ * UUUUUUUUUUUUUUURRRRGHHHHHHHHHH!!!!!!!!! --- pws
+ */
 
 #define MMARK       ((unsigned long) 1)
 #define mmarked(v)  (((unsigned long) (v)) & MMARK)
@@ -2325,8 +2329,7 @@ domenuselect(Hookdef dummy, Chdata dat)
     for (;;) {
 	METACHECK();
 
-    	mtab_been_reallocated = 0;
-	if (mline < 0) {
+	if (mline < 0 || mtab_been_reallocated) {
 	    int x, y;
 	    Cmatch **p = mtab;
 
@@ -2342,6 +2345,7 @@ domenuselect(Hookdef dummy, Chdata dat)
 	    if (y < mlines)
 		mline = y;
 	}
+    	mtab_been_reallocated = 0;
 	DPUTS(mline < 0,
 	      "BUG: mline < 0 after re-scanning mtab in domenuselect()");
 	while (mline < mlbeg)