From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28459 invoked by alias); 2 Nov 2010 20:41:48 -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: 28385 Received: (qmail 17993 invoked from network); 2 Nov 2010 20:41:46 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.213.171 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:cc:content-type; bh=hJc5QSkU+Nn8LmQDDLeQNan0wCyMhugUsYtPzTAwxJw=; b=dQx5ob1ZxRtCqlP3C6sGob+PMXedF2u7g4G8B+VtMpR8PfKvealVw80tK8IvSZcGTX wnLpRUInp0WFSDziMqIBdy3si+ouNhR9dDsCTwV+dVMtCILd35qaMynioqGETyqHLMt0 3bttv7zpWdtGw7hYQoQmftGghKIX/d2Xez12U= 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 :cc:content-type; b=dgweO1gYtIb43Md6fqV+2ixQ7F+oJFQAyGQAFbAniQmxOB7YX992vyWwTJ3f/M0Rvv akgmRwv72XI8sHq7K8+T0goZoxbFRRxdmNwY3+epTq9Hf2ZdOfEFCQXBAhnJUAUg8LZP VAB7r9HtDP3KhqZomIEXHEF/9O0OiNGxpB5ck= MIME-Version: 1.0 In-Reply-To: <20101102163428.GQ672@jenkins.home.ifup.org> References: <20101009221700.GA60765@redoubt.spodhuis.org> <20101102163428.GQ672@jenkins.home.ifup.org> Date: Tue, 2 Nov 2010 21:41:39 +0100 Message-ID: Subject: Re: [[ 0 =~ 1 || 1 = 0 ]] returns true From: Mikael Magnusson To: Brandon Philips Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 2 November 2010 17:34, Brandon Philips wrote: > On 18:17 Sat 09 Oct 2010, Phil Pennock wrote: >> The dropping is short-circuiting, the same as in all shell evaluation of >> && and ||. The shell stops once it knows enough to know the answer. So >> false to the left of && will stop, and true to the left of || will stop. >> >> % [[ 1 == 1 && 3 == 2 && 4 == 4 && sb == sb ]] >> +zsh:12> [[ 1 == 1 && 3 == 2 ]] >> % [[ 1 == 1 && 3 != 2 && 4 == 4 && sb == sb ]] >> +zsh:13> [[ 1 == 1 && 3 != 2 && 4 == 4 && sb == sb ]] >> >> So the issue appears to just be what the OP wrote, that =~ is messing up >> &&/|| by inserting a sense inversion. >> >> % [[ 1 =~ 0 || 1 == 1 ]] >> +zsh:18> [[ 1 -regex-match 0 || ! 1 == 1 ]] >> % [[ 1 -regex-match 0 || 1 == 1 ]] >> +zsh:19> [[ 1 -regex-match 0 || 1 == 1 ]] >> >> So it's related to use of =~ rather than -regex-match. It's independent >> of whether or not zsh/pcre is loaded. So this is probably a bug which I >> introduced when I wrote the =~ syntax support. Looking now. > > Did you find anything? Curious on what the state of this is. > > Let me know if I can help. It was fixed in cvs not long after this. I think the fix-mail started a new thread somewhere. -- Mikael Magnusson