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

Re: Segmentation fault on Ctrl-D



On Wed, 7 May 2008 16:35:05 +0900
"Hiroto Kagotani" <hiroto.kagotani@xxxxxxxxx> wrote:
> Hi there,
> 
> I'm new to this list so please let me know if I'm missing any important
> information.
> 
> zsh (CVS, 4.3.6, 4.3.4 on FreeBSD, and 4.3.4 on Cygwin) crashes
> when I type a key sequence followed by two Ctrl-D's.
> 
> zsh -f
> q<TAB><TAB><^D><^D>
>  -> Segmentation fault
> 
> "q" may be any letter.  If you have a lot of commands begin with the letter,
> type three <TAB>s to force zsh choose a candidate.

Thanks.  This was a very obvious mistake when I looked.  Unfortunately
old-fashion completion doesn't get the same level of testing as the new
sort nowadays.

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.74
diff -u -r1.74 compresult.c
--- Src/Zle/compresult.c	13 Apr 2008 16:58:42 -0000	1.74
+++ Src/Zle/compresult.c	7 May 2008 08:44:21 -0000
@@ -1188,6 +1188,12 @@
 {
     int was_meta;
 
+    /* Just list the matches if the list was requested. */
+    if (lst == COMP_LIST_COMPLETE) {
+	showinglist = -2;
+	return;
+    }
+
     /* Already metafied when called from domenuselect already */
     if (zlemetaline == NULL) {
 	was_meta = 0;
@@ -1195,12 +1201,6 @@
     } else
 	was_meta = 1;
 
-    /* Just list the matches if the list was requested. */
-    if (lst == COMP_LIST_COMPLETE) {
-	showinglist = -2;
-	return;
-    }
-
     /* Otherwise go to the next match in the array... */
     do {
 	if (!*++(minfo.cur)) {

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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