From 32b4cb0e73cdb01c467a0484e906d28d7c104c64 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Wed, 18 Mar 2015 18:01:54 -0700 Subject: 34734: further aliasing adjustments and doc restrict token aliasing (34641) to global aliases; tighten up POSIX_ALIASES to better match spec; update Aliasing doc to cover this and clarify older behavior 2015-03-18 Peter Stephenson * 34723: configure.ac: turn off fixed site function directory if --- Src/lex.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/lex.c b/Src/lex.c index 494ea8870..1eb0bc7d7 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -1740,12 +1740,13 @@ checkalias(void) if (!noaliases && isset(ALIASESOPT) && (!isset(POSIXALIASES) || - !reswdtab->getnode(reswdtab, zshlextext))) { + (tok == STRING && !reswdtab->getnode(reswdtab, zshlextext)))) { char *suf; an = (Alias) aliastab->getnode(aliastab, zshlextext); if (an && !an->inuse && - ((an->node.flags & ALIAS_GLOBAL) || incmdpos || inalmore)) { + ((an->node.flags & ALIAS_GLOBAL) || + (incmdpos && tok == STRING) || inalmore)) { inpush(an->text, INP_ALIAS, an); if (an->text[0] == ' ' && !(an->node.flags & ALIAS_GLOBAL)) aliasspaceflag = 1; @@ -1784,6 +1785,8 @@ exalias(void) if (!tokstr) { zshlextext = tokstrings[tok]; + if (tok == NEWLIN) + return 0; return checkalias(); } else { VARARR(char, copy, (strlen(tokstr) + 1)); @@ -1791,6 +1794,9 @@ 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++);); -- cgit 1.4.1