zsh-workers
 help / color / mirror / code / Atom feed
* Segmentation fault caused by completion system
@ 2003-04-17 16:02 Haakon Riiser
  2003-04-23 17:49 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Haakon Riiser @ 2003-04-17 16:02 UTC (permalink / raw)
  To: zsh-workers

"*" in front of "-+" or "+-" in the optspecs to "_arguments"
causes a segmentation fault on completion.  Here's an example:

  #compdef foo
  _arguments '*-+bar'

Now try using it:

  % foo <TAB>
  foo zsh: segmentation fault (core dumped)  zsh

System info:

  zsh 4.0.6 (i386-slackware-linux-gnu)
  Slackware 9.0 (gcc 3.2.2, termcap 2.0.8, libc 2.3.1)

(I have not subscribed to the mailing list, so if you need anything
else from me, please Cc my private email address.)

-- 
 Haakon


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Segmentation fault caused by completion system
  2003-04-17 16:02 Segmentation fault caused by completion system Haakon Riiser
@ 2003-04-23 17:49 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2003-04-23 17:49 UTC (permalink / raw)
  To: Haakon Riiser, zsh-workers

"Haakon Riiser" wrote:
> "*" in front of "-+" or "+-" in the optspecs to "_arguments"
> causes a segmentation fault on completion.

This appears to be a trivial fix.

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.83
diff -u -r1.83 computil.c
--- Src/Zle/computil.c	27 Aug 2002 21:10:34 -0000	1.83
+++ Src/Zle/computil.c	23 Apr 2003 18:43:45 -0000
@@ -1397,7 +1397,7 @@
 		    opt->descr = NULL;
 	    } else
 		opt->descr = NULL;
-	    opt->xor = (again == 1 ? zarrdup(xor) : xor);
+	    opt->xor = (again == 1 && xor ? zarrdup(xor) : xor);
 	    opt->type = otype;
 	    opt->args = oargs;
 	    opt->num = nopts++;

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-23 18:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-17 16:02 Segmentation fault caused by completion system Haakon Riiser
2003-04-23 17:49 ` 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).