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

Re: globcomplete bug + bug when compctl.so not loaded + init patch



Peter Stephenson wrote:

> Looks like things go haywire when globcomplete is set with new completion.
> 
> % _foo() { complist -k '(one two)'; }
> % defcomp _foo foo
> % setopt globcomplete
> % foo o*e<TAB>
> 
> The shell hangs and has to be got rid of with kill -9.  It looks like it's
> happening during the complist.  

The problem was that the second pointer into the match wasn't modified 
together with the main pointer. This caused a wrong value to be placed 
in one of those cline structs and later this led to an endless loop
(trying to make a negative and decremented value match a positive value).

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Wed Feb 24 15:54:41 1999
+++ Src/Zle/zle_tricky.c	Wed Feb 24 16:07:43 1999
@@ -4311,6 +4311,7 @@
 		strcat(tt, s);
 		if (lpsuf)
 		    strcat(tt, lpsuf);
+		e += (tt - s);
 		untokenize(s = tt);
 		sl = strlen(s);
 	    }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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