mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-01 18:30:55 +01:00
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 <p.stephenson@samsung.com> * 34723: configure.ac: turn off fixed site function directory if
This commit is contained in:
parent
0b00462644
commit
32b4cb0e73
4 changed files with 35 additions and 13 deletions
10
Src/lex.c
10
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++););
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue