about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-03-28 21:08:02 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-03-28 21:08:02 -0700
commit7d2b53f65bae3f16cf318103e53eb8350af6bd8a (patch)
treeab26af97a44e98f9d48b66485bdd93b2475a5866
parentab4065623aa07a2bf74edcda62d29d02154779d8 (diff)
downloadzsh-7d2b53f65bae3f16cf318103e53eb8350af6bd8a.tar.gz
zsh-7d2b53f65bae3f16cf318103e53eb8350af6bd8a.tar.xz
zsh-7d2b53f65bae3f16cf318103e53eb8350af6bd8a.zip
34804: refine POSIX_ALIAS change to preserve old behavior of [[ ]] conditionals
-rw-r--r--ChangeLog5
-rw-r--r--Src/lex.c5
-rw-r--r--Test/B07emulate.ztst4
3 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index dddd2291c..5beb1f88f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-28  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 34804: Src/lex.c: refine 34734 POSIX_ALIAS change to preserve
+	old behavior of [[ ]] conditionals
+
 2015-03-27  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 34788: Src/lex.c: refine errflag handling in cmd_or_math()
diff --git a/Src/lex.c b/Src/lex.c
index 4d8355bac..2e611707e 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 315206a20..2de097e25 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