From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14766 invoked by alias); 6 Dec 2010 01:53:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28485 Received: (qmail 13011 invoked from network); 6 Dec 2010 01:53:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.43 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <237967ef0911221022q222db8bau2ab86c82004e957@mail.gmail.com> References: <237967ef0911221022q222db8bau2ab86c82004e957@mail.gmail.com> Date: Mon, 6 Dec 2010 02:53:44 +0100 Message-ID: Subject: Re: _main_complete:343: bad pattern: a[ From: Mikael Magnusson To: zsh workers Content-Type: text/plain; charset=UTF-8 On 22 November 2009 19:22, Mikael Magnusson wrote: > % zsh -f > % autoload -U compinit; compinit > % $a[[ > _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[[ */ 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[[] 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