From 7d2b53f65bae3f16cf318103e53eb8350af6bd8a Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 28 Mar 2015 21:08:02 -0700 Subject: 34804: refine POSIX_ALIAS change to preserve old behavior of [[ ]] conditionals --- ChangeLog | 5 +++++ Src/lex.c | 5 +---- Test/B07emulate.ztst | 4 ++++ 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 + + * 34804: Src/lex.c: refine 34734 POSIX_ALIAS change to preserve + old behavior of [[ ]] conditionals + 2015-03-27 Barton E. Schaefer * 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 -- cgit 1.4.1