zsh-workers
 help / color / mirror / code / Atom feed
* cvs <TAB> dumps core.
@ 1999-11-19 16:34 Tanaka Akira
  1999-11-20 19:38 ` PATCH: " Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Tanaka Akira @ 1999-11-19 16:34 UTC (permalink / raw)
  To: zsh-workers

Z:akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% cvs zsh: segmentation fault (core dumped)  Src/zsh -f
Z:akr@is27e1u11% 

With `set -x':

...
+_arguments:303> SUFFIX= 
+_arguments:304> IPREFIX=--allow-root= 
+_arguments:305> matched=yes 
+_arguments:306> comparguments -L --allow-root descr action subc
zsh: segmentation fault (core dumped)  Src/zsh -f
Z:akr@is27e1u11% 

(gdb) where
#0  0xff136d84 in strlen ()
#1  0x409c4 in tricat (s1=0x2257a0 "--allow-root", s2=0xff03ca90 "-1", s3=0x0)
    at glob.c:1645
#2  0xff037764 in bin_comparguments (nam=0x228470 "comparguments", 
    args=0x228560, ops=0xffbe86c8 "", func=0) at computil.c:1445
#3  0x1bff4 in execbuiltin (args=0x228468, bn=0xff04d138) at builtin.c:371
#4  0x35820 in execcmd (cmd=0x220e80, input=0, output=0, how=2, last1=2)
    at exec.c:2056

zsh should have automatic regression test suite of completion system.
Isn't it?
-- 
Tanaka Akira


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

* PATCH: Re: cvs <TAB> dumps core.
  1999-11-19 16:34 cvs <TAB> dumps core Tanaka Akira
@ 1999-11-20 19:38 ` Bart Schaefer
  1999-11-21  4:07   ` Tanaka Akira
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 1999-11-20 19:38 UTC (permalink / raw)
  To: Tanaka Akira, zsh-workers

This was pretty obvious.

Index: Src/Zle/computil.c
===================================================================
@@ -1442,7 +1442,7 @@
 		setsparam(args[3], ztrdup(opt->args->action));
 
 		if (args[4])
-		    setsparam(args[4], tricat(opt->name, "-1", NULL));
+		    setsparam(args[4], tricat(opt->name, "-1", ""));
 
 		return 0;
 	    }

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* Re: PATCH: Re: cvs <TAB> dumps core.
  1999-11-20 19:38 ` PATCH: " Bart Schaefer
@ 1999-11-21  4:07   ` Tanaka Akira
  1999-11-21  5:12     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Tanaka Akira @ 1999-11-21  4:07 UTC (permalink / raw)
  To: zsh-workers

In article <991120193846.ZM14808@candle.brasslantern.com>,
  "Bart Schaefer" <schaefer@candle.brasslantern.com> writes:

> This was pretty obvious.

Thanks.  But, I found another problem.

Z:akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% cvs <TAB>
CVS/           Src/           commit        init          rtag
Completion/    StartupFiles/  diff          log           status
Config/        Util/          edit          login         tag
Doc/           add           editors       logout        unedit
Etc/           admin         export        rdiff         update
Functions/     annotate      history       release       watch
Misc/          checkout      import        remove        watchers

Wow. filenames shouldn't listed.

And after second <TAB>:

is27e1u11% cvs --allow-root=CVS/

Of cause, the option `--allow-root' shouldn't completed.
-- 
Tanaka Akira


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

* Re: PATCH: Re: cvs <TAB> dumps core.
  1999-11-21  4:07   ` Tanaka Akira
@ 1999-11-21  5:12     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 1999-11-21  5:12 UTC (permalink / raw)
  To: zsh-workers

On Nov 21,  1:07pm, Tanaka Akira wrote:
} Subject: Re: PATCH: Re: cvs <TAB> dumps core.
}
} Z:akr@is27e1u11% Src/zsh -f
} is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
} is27e1u11% cvs <TAB>
} CVS/           Src/           commit        init          rtag
} Completion/    StartupFiles/  diff          log           status
} Config/        Util/          edit          login         tag
} Doc/           add           editors       logout        unedit
} Etc/           admin         export        rdiff         update
} Functions/     annotate      history       release       watch
} Misc/          checkout      import        remove        watchers
} 
} Wow. filenames shouldn't listed.

It's only directory names, and it's related to:

} is27e1u11% cvs --allow-root=CVS/
} 
} Of cause, the option `--allow-root' shouldn't completed.

If you do
    compstyle '*:descriptions' format '%d'
before trying "cvs <TAB>", you'll see that it says

cvs command
rootdir

So it's listing directories to be the argument of --allow-root=.  This
in turn is because _arguments at line 299 is calling

	compadd -M  -D equal - --allow_root

and then setting IPREFIX to --allow-root= at line 304, etc.  However,
it's beyond my understanding of the interaction between _arguments and
comparguments to tell how it got into that state in the first place.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~1999-11-21  5:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-19 16:34 cvs <TAB> dumps core Tanaka Akira
1999-11-20 19:38 ` PATCH: " Bart Schaefer
1999-11-21  4:07   ` Tanaka Akira
1999-11-21  5:12     ` Bart Schaefer

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).