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

PATCH: fix for completion with groups



Hello

This:

  % compctl -J foo -k '(foo)' foo
  % foo <TAB>

failed utterly.

This is caused by the old code for handling the case with only one
match which looks at the first match in the first group of
matches. But in the example above the first group doesn't have a
match, so we get a SEGV in do_single().

Bye
 Sven

*** os/Zle/zle_tricky.c	Tue Jan  5 13:03:03 1999
--- Src/Zle/zle_tricky.c	Tue Jan  5 13:04:34 1999
***************
*** 2955,2960 ****
--- 2955,2962 ----
  
  	    else if (nmatches == 1) {
  		/* Only one match. */
+ 		while (!amatches->mcount)
+ 		    amatches = amatches->next;
  		do_single(amatches->matches[0]);
  		invalidatelist();
  	    }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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