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

Re: _complete_debug causes core dump.



Bart Schaefer wrote:

> On May 12,  5:07am, Tanaka Akira wrote:
> } Subject: _complete_debug causes core dump.
> }
> } _complete_debug causes core dump as follows.
> 
> It's not _complete_debug, it's _message.  If you call _message when there
> are no matches (which _complete_debug does in this case), makecomplist()
> returns 1 and docompletion() derefs a null pointer.  If you don't call
> _message (the case when _main_complete is called directly) makecomplist()
> returns 0 and most of docompletion() is bypassed by a goto.

The problem was that the branch should only be executed when there are 
matches which was ensured before that `compadd -x' change.

Bye
 Sven

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.18
diff -u -r1.18 compcore.c
--- Src/Zle/compcore.c	2000/05/11 08:40:11	1.18
+++ Src/Zle/compcore.c	2000/05/12 07:01:13
@@ -400,7 +400,7 @@
 	if (nmatches > 1 && diffmatches) {
 	    /* There is more than one match. */
 	    ret = do_ambiguous();
-	} else if (nmatches == 1 || !diffmatches) {
+	} else if (nmatches == 1 || (nmatches > 1 && !diffmatches)) {
 	    /* Only one match. */
 	    Cmgroup m = amatches;
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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