Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: LISTMAX and menu select



Tanaka Akira wrote:

> zsh dumps core as follows.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D
> is27e1u11% zstyle ':completion*:default' menu select=1
> is27e1u11% LISTMAX=2
> is27e1u11% ls M<TAB>
> zsh: do you wish to see all 4 possibilities? n
> is27e1u11% ls M<TAB>
> zsh: do you wish to see all 4 possibilities? n
> is27e1u11% ls META-FAQzsh: segmentation fault (core dumped)  Src/zsh -f

complist didn't use the answer correctly (it tried to menu-select with 
no list).

The patch also tries to avoid asking the same question a second time
when auto-menu starts. I guess I once had a reason for the tests in
asklist(), but they look wrong.

Bye
 Sven

diff -ru ../z.old/Src/Zle/complist.c Src/Zle/complist.c
--- ../z.old/Src/Zle/complist.c	Mon Jan 31 10:49:50 2000
+++ Src/Zle/complist.c	Mon Jan 31 11:14:04 2000
@@ -782,7 +782,7 @@
 
     if (asklist()) {
 	amatches = oamatches;
-	return 1;
+	return (noselect = 1);
     }
     if (mselect >= 0) {
 	int i;
diff -ru ../z.old/Src/Zle/compresult.c Src/Zle/compresult.c
--- ../z.old/Src/Zle/compresult.c	Mon Jan 31 10:49:51 2000
+++ Src/Zle/compresult.c	Mon Jan 31 11:31:22 2000
@@ -1541,8 +1541,7 @@
 		tcmultout(TCUP, TCMULTUP, nlnct);
 	    } else
 		putc('\n', shout);
-	    if (minfo.cur)
-		minfo.asked = 2;
+	    minfo.asked = 2;
 	    return 1;
 	}
 	if (clearflag) {
@@ -1553,10 +1552,9 @@
 	} else
 	    putc('\n', shout);
 	settyinfo(&shttyinfo);
-	if (minfo.cur)
-	    minfo.asked = 1;
+	minfo.asked = 1;
     }
-    return 0;
+    return (minfo.asked ? minfo.asked - 1 : 0);
 }
 
 /**/

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author