Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _main_complete:343: bad pattern: a[
- X-seq: zsh-workers 28485
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: _main_complete:343: bad pattern: a[
- Date: Mon, 6 Dec 2010 02:53:44 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=Zs0hh1VlcLMPZVIzPkd7uUIS3wfWxghDL5Cb0q7NouI=; b=h8JO+tSsEZqVB+zHTAEgI9DuH1MYBRdzF3evV5wTObjd/x7eXeD5uZQmnATq3uhWOI nfE+ZynEbA5n0p4SWP8M050LjlXkBRJB7DIIGPi+3UbKPgSMX3HcFQUdKe3trTcZ6ZWF hu4rNUPM6otPW5S0Ye8yJWQiLNkvL4wlN2cG4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VhsvQyVB8oXYFoVNngxNVBfhUPGbPo8v0JQbvOxV96zno+KsgaOq+m+oUNsb/rltp2 d80RS2DkhiJ+pRoOTgJfUaoHt98Lvelri3b5gBkqehLN7ULaUHNDDjMsAbBIeU6OL9I6 fmPGkjM9f3ZnPCYkecEdtmVz8KxkoMpsRGJe0=
- In-reply-to: <237967ef0911221022q222db8bau2ab86c82004e957@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <237967ef0911221022q222db8bau2ab86c82004e957@xxxxxxxxxxxxxx>
On 22 November 2009 19:22, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> % zsh -f
> % autoload -U compinit; compinit
> % $a[[<tab>
> _main_complete:343: bad pattern: a[
There are lots of places in the code that say "bad pattern:", after
adding identifiers to all of them, I found it's this one in glob.c
if (!q || errflag) { /* if parsing failed */
restore_globstate(saved);
if (unset(BADPATTERN)) {
if (!nountok)
untokenize(ostr);
insertlinknode(list, node, ostr);
return;
}
errflag = 0;
/* $a[[<tab> */
zerr("bad pattern: %s", ostr);
return;
}
around line 1730. The real weird thing is that this is triggered by
_lastcomp=( "${(@kv)compstate}" )
in _main_complete. Trying to just echo $compstate or variations
thereof fail in the same way. Now of course I'm curious why anything
is trying to match a pattern when accessing a variable. Breaking at
the print shows this backtrace, I realize I have no idea what any of
these functions are for.
I notice also that $a[[]<tab> doesn't produce an error, but then
leaves the [] in place which does produce an error when you run the
command since it's obviously broken syntax.
#0 zglob (list=0x7ffff7fee860, np=0x7ffff7feef88, nountok=0) at glob.c:1736
#1 0x00000000004810c9 in globlist (list=0x7ffff7fee860, nountok=0) at
subst.c:353
#2 0x00000000004299a9 in addvars (state=0x7fffffffc4a0, pc=0x6f2284,
addflags=0)
at exec.c:2157
#3 0x0000000000426d83 in execsimple (state=0x7fffffffc4a0) at exec.c:1053
#4 0x00000000004270ff in execlist (state=0x7fffffffc4a0,
dont_change_job=1, exiting=0)
at exec.c:1167
#5 0x0000000000426c88 in execode (p=0x768070, dont_change_job=1, exiting=0,
context=0x499a0f "loadautofunc") at exec.c:1020
#6 0x000000000042f2f8 in execautofn (state=0x7fffffffcc30, do_exec=0)
at exec.c:4272
#7 0x000000000042ca77 in execcmd (state=0x7fffffffcc30, input=0,
output=0, how=18, last1=2)
at exec.c:3120
#8 0x000000000042861f in execpline2 (state=0x7fffffffcc30, pcode=3,
how=18, input=0,
output=0, last1=0) at exec.c:1632
#9 0x0000000000427ad2 in execpline (state=0x7fffffffcc30,
slcode=3074, how=18, last1=0)
at exec.c:1416
#10 0x0000000000427266 in execlist (state=0x7fffffffcc30,
dont_change_job=1, exiting=0)
at exec.c:1199
#11 0x0000000000426c88 in execode (p=0x768460, dont_change_job=1, exiting=0,
context=0x499aa6 "shfunc") at exec.c:1020
#12 0x000000000042fe2f in runshfunc (prog=0x768460, wrap=0x0,
name=0x7ffff7feb030 "_main_complete") at exec.c:4614
#13 0x00007ffff6b69ecf in comp_wrapper (prog=0x768460, w=0x0,
name=0x7ffff7feb030 "_main_complete") at complete.c:1455
#14 0x000000000042fd95 in runshfunc (prog=0x768460, wrap=0x7ffff6d87d80,
name=0x7ffff7feb030 "_main_complete") at exec.c:4599
#15 0x000000000042fb0d in doshfunc (shfunc=0x76aa20, doshargs=0x0,
noreturnval=0)
at exec.c:4508
#16 0x00007ffff6b6c8a3 in callcompfunc (s=0x7ffff7fef690 "",
fn=0x7a5400 "_main_complete")
at compcore.c:817
#17 0x00007ffff6b6d17e in makecomplist (s=0x7ffff7fef690 "", incmd=1, lst=0)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author