From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12436 invoked by alias); 28 Mar 2015 22:45:04 -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: 34802 Received: (qmail 4717 invoked from network); 28 Mar 2015 22:45:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [80.3.228.158] X-Spam: 0 X-Authority: v=2.1 cv=Ku/D2AmN c=1 sm=1 tr=0 a=P+FLVI8RzFchTbbqTxIDRw==:117 a=P+FLVI8RzFchTbbqTxIDRw==:17 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=q2GGsy2AAAAA:8 a=RJP-gaPejO8SCXor0WEA:9 a=CjuIK1q_8ugA:10 Date: Sat, 28 Mar 2015 22:44:58 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [[ is being treated as a pattern in the command/reserved word position. Message-ID: <20150328224458.3ab1d39a@ntlworld.com> In-Reply-To: <150328152430.ZM18574@torch.brasslantern.com> References: <55171842.7030505@gmx.com> <150328144428.ZM5583@torch.brasslantern.com> <55172355.80409@gmx.com> <150328152430.ZM18574@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 28 Mar 2015 15:24:30 -0700 Bart Schaefer wrote: > On Mar 28, 5:55pm, Eric Cook wrote: > } > } % print $ZSH_PATCHLEVEL; emulate sh -c '[[ a == a ]]' > } zsh-5.0.7-362-gab40656 > } zsh: command not found: [[ > } > } Did that behavior change? > > Aha. That makes more sense. > > The '[[' reserved word is handled a special kind of built-in alias [*] > and the change to POSIX_ALIASES handling caused that to be disabled. > > This will take a bit of thought. Is this good enough? Looks like we need some more emulation tests for POSIX_ALIASES. pws diff --git a/Src/lex.c b/Src/lex.c index 6d0079c..4758354 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1789,13 +1789,14 @@ exalias(void) return 0; return checkalias(); } else { + int noalias = 0; VARARR(char, copy, (strlen(tokstr) + 1)); if (has_token(tokstr)) { char *p, *t; if (isset(POSIXALIASES)) - return 0; + noalias = 1; zshlextext = p = copy; for (t = tokstr; @@ -1816,7 +1817,7 @@ exalias(void) if (tok == STRING) { /* Check for an alias */ - if (checkalias()) { + if (!noalias && checkalias()) { if (zshlextext == copy) zshlextext = tokstr; return 1;