zsh-workers
 help / color / mirror / code / Atom feed
* Re: segfault on repeated tab completion after menu selection
       [not found] <200607302056.10331.cht@chello.at>
@ 2006-07-30 19:48 ` Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2006-07-30 19:48 UTC (permalink / raw)
  To: Christian Taylor, Zsh hackers list

Christian Taylor wrote:
> Hi,
> 
> I use zsh 4.2.6 on Linux (vanilla 2.6.17.7 kernel). Under the following 
> circumstances I can reliably produce a segfault:
> 
> % zsh -f
> % autoload -U compinit; compinit
> % bindkey '+' accept-and-infer-next-history
> % zstyle ':completion:*' menu select yes=long
> % zstyle ':completion:*:warnings' format 'No matches for: %d'
> 
> % cd <some directory with files/subdirectories in it>
> % mkdir xyz
> % ls <TAB><TAB>
> >From the menu, select the empty xyz directory, hit "+". zsh accepts the 
> selection and says that there are no further matches in that directory.
> At this point, pressing either "+<TAB>" or "<TAB><TAB>" will result in:
> zsh: segmentation fault  zsh -f

That's certainly a bug.

I've had some success with the following patch.  Does this fix it in
your case?  Unfortunately nobody currently has the seventeen years of
postdoctoral studies necessary to understand the code properly.

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.84
diff -u -r1.84 compcore.c
--- Src/Zle/compcore.c	10 Jul 2006 13:08:24 -0000	1.84
+++ Src/Zle/compcore.c	30 Jul 2006 19:47:43 -0000
@@ -466,12 +466,12 @@
 
     /* If we are doing a menu-completion... */
 
-    if (menucmp && *lst != COMP_LIST_EXPAND && 
+    if (minfo.cur && menucmp && *lst != COMP_LIST_EXPAND && 
 	(menucmp != 1 || !compwidget || compwidget == lastcompwidget)) {
 	do_menucmp(*lst);
 	return 1;
     }
-    if (menucmp && validlist && *lst == COMP_LIST_COMPLETE) {
+    if (minfo.cur && menucmp && validlist && *lst == COMP_LIST_COMPLETE) {
 	showinglist = -2;
 	onlyexpl = listdat.valid = 0;
 	return 1;

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-30 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200607302056.10331.cht@chello.at>
2006-07-30 19:48 ` segfault on repeated tab completion after menu selection Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).