From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7964 invoked by alias); 28 Mar 2015 22:45:29 -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: 34804 Received: (qmail 225 invoked from network); 28 Mar 2015 22:45:28 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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:content-type; bh=wAZfP73y4LH9aCeC0TAARkiLfoS4PdxeAgOryvhc7hs=; b=AvA6zrCNn++NfHqsrb44nirnyOtEuQseh2RiN2nLAcQgYQ/oWG9DwMTOr7L8ioTX0G YKQhenCC9ZS394bBgxUJ9h8mTmrPfqMwVnQDlftHh7cVXMLkl19Pjassg2EEQG8X1607 SXiEZcccO/9UcVJg23S0gcxS9dgFmirQKPdeUvpIgzTCo3esDkEfm1tMY9K6Xvuosghm +dmWXOaCxPchCXTGndWgoiZx5GdIUeJHCrrsIT8KES7V9pYmyaotsJq3VKvDjWHqKPgs q7vu5kzjAQ5kNNzwof4isRPVtjuaVFFOflIT/f2d7/FWZTAhzfCPCdgEE2dz1iwTndXx 1lXw== X-Gm-Message-State: ALoCoQnk5WPagd/sVKZKODioW8QDOTnpSi72iUNk/Am7qHwSd9P6KotK337IKR7NZJmKdy+4aP9m X-Received: by 10.202.219.87 with SMTP id s84mr15847456oig.114.1427582727063; Sat, 28 Mar 2015 15:45:27 -0700 (PDT) From: Bart Schaefer Message-Id: <150328154524.ZM6078@torch.brasslantern.com> Date: Sat, 28 Mar 2015 15:45:24 -0700 In-Reply-To: <6862591427582011@web25h.yandex.ru> Comments: In reply to ZyX "Re: [[ is being treated as a pattern in the command/reserved word position." (Mar 29, 1:33am) References: <55171842.7030505@gmx.com> <150328144428.ZM5583@torch.brasslantern.com> <55172355.80409@gmx.com> <150328152430.ZM18574@torch.brasslantern.com> <6862591427582011@web25h.yandex.ru> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "zsh-workers@zsh.org" Subject: Re: [[ is being treated as a pattern in the command/reserved word position. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 29, 1:33am, ZyX wrote: } Subject: Re: [[ is being treated as a pattern in the command/reserved word } } 29.03.2015, 01:25, "Bart Schaefer" : } > } > The '[[' reserved word is handled a special kind of built-in alias [*] } > and the change to POSIX_ALIASES handling caused that to be disabled. } } I would say that this is actually an expected behaviour: } `posh -c '[[ a == a ]]'` will show `posh: [[: not found` } because `[[` is not in POSIX. Similar error will be shown by dash. That could be, but POSIX_ALIASES is the wrong way to handle that. If we wanted to remove the '[[' extension for posix emulation, we should do `disable -r "[["` instead. diff --git a/Src/lex.c b/Src/lex.c index 4d8355b..2e61170 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1794,9 +1794,6 @@ exalias(void) if (has_token(tokstr)) { char *p, *t; - if (isset(POSIXALIASES)) - return 0; - zshlextext = p = copy; for (t = tokstr; (*p++ = itok(*t) ? ztokens[*t++ - Pound] : *t++);); @@ -1816,7 +1813,7 @@ exalias(void) if (tok == STRING) { /* Check for an alias */ - if (checkalias()) { + if ((zshlextext != copy || !isset(POSIXALIASES)) && checkalias()) { if (zshlextext == copy) zshlextext = tokstr; return 1; diff --git a/Test/B07emulate.ztst b/Test/B07emulate.ztst index 315206a..2de097e 100644 --- a/Test/B07emulate.ztst +++ b/Test/B07emulate.ztst @@ -247,3 +247,7 @@ >extendedglob is initially off >bareglobqual is still on >extendedglob is on, too + + emulate sh -c '[[ a == a ]]' +0:regression test for POSIX_ALIASES reserved words +F:Some reserved tokens are handled in alias expansion