From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23114 invoked by alias); 29 Nov 2016 06:44:58 -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: 40034 Received: (qmail 24597 invoked from network); 29 Nov 2016 06:44:58 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.46):SA:0(-0.0/5.0):. Processed in 0.735531 secs); 29 Nov 2016 06:44:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.213.46 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=gvnoh2O7HY9OelpzMvq2ziS7dr7fuO6ICXbABPz4+vw=; b=OTPIR/DtM8RZ9NqDTnzlrtLa7ZPEwm3eSwa2jXpAjzksdw7EbnHbnnbVjz4hrMzqr4 5MXUOClGT44IsPhfgd0T/ki3nEYyqmk8Z6lUWyjr8XQisvlMyPR/fT4eYi2gKSjj1YR2 qMwVaThTwY+b6N7rzZZ/dr32kDGZQl0Ebj4+l97V01OPbLOLrJlEhK0PO28/WtTXi9H1 D1t6Kt/MMIgyUAGtZdQD8lHTxNbWK20S1nUHEbUABeVKiIcHSt97QMVadyZXPGugW6+r Xg4o8E+UqQRq+1/PfZTyo24kgzB/U0zN8nqf/2Tr/5R9bbhqasfmqJ1F0hUvd4vFVmtH yvrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=gvnoh2O7HY9OelpzMvq2ziS7dr7fuO6ICXbABPz4+vw=; b=UCw/7LwkrGa88OG68AeAAEZoc+QCRs6VLezLQBPRqCe5G4S1QeBRqSefcGPGLpcGi6 fnDiINgdFdJRS3lDc7csvTra7PFHrErDtcxVSK/PMQGJE7aNb7zpQkI6Pn2Q0kvPuZs1 /xUTWsqiGIxYhopFdBuMIEh7QuhuNUFoUuJZxGeGlMXyhJVHXizm4LUwBUA3QZ5XTo7n LdoAj2Q9QsZgbliEVlIcIomn/BoiX4tOK2v55pze7vFFgk0q3gz9IFan2RreZ1j6Cm5D wjjK1AGXpekUGcCAvvbMM+G43bEFJ6R0R0vyE734AjfbOHRFn79jem5LTcZe6ojoiB0N vhDg== X-Gm-Message-State: AKaTC02bDQX0/zyEcrwICeub63kYhsHgUP3DSCvgfNtmCK2hTrJQ94/P4j6o5iZUwhpJBg== X-Received: by 10.31.141.196 with SMTP id p187mr9383792vkd.136.1480401891887; Mon, 28 Nov 2016 22:44:51 -0800 (PST) From: Bart Schaefer Message-Id: <161128224450.ZM25252@torch.brasslantern.com> Date: Mon, 28 Nov 2016 22:44:50 -0800 In-Reply-To: <20161123012650.GA4241@localhost.localdomain> Comments: In reply to Han Pingtian "Re: Remind me why ${name+word} is the way it is?" (Nov 23, 9:26am) References: <161111203400.ZM31567@torch.brasslantern.com> <20161117023325.GA3324@localhost.localdomain> <20161123012650.GA4241@localhost.localdomain> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Spurious "no match" (Re: Remind me why ${name+word} is the way it is?) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 23, 9:26am, Han Pingtian wrote: } Subject: Re: Remind me why ${name+word} is the way it is? } } On Wed, Nov 16, 2016 at 09:34:32PM -0800, Bart Schaefer wrote: } > On Wed, Nov 16, 2016 at 6:33 PM, Han Pingtian wrote: } > > } > > % name=a;echo ${name:+foo[bar]} } > > zsh: no match } > > % } > > url-quote-magic:10: no match } > } Oh, I can still reproduce this problem by running } } name=a;echo ${name:+foo[bar]} } } two times. So, this isn't url-quote-magic's fault -- the value of the internal C variable badcshglob is never getting cleared after the error has been ignored, so it trips the next time any command passes through a test for whether a glob has failed. Any user-defined widget that assigns to an array ought to generate the same error. This seems to do the right thing, but someone please review: diff --git a/Src/subst.c b/Src/subst.c index c7c5522..42e741a 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -411,7 +411,9 @@ globlist(LinkList list, int nountok) next = nextnode(node); zglob(list, node, nountok); } - if (badcshglob == 1) + if (noerrs) + badcshglob = 0; + else if (badcshglob == 1) zerr("no match"); }