about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-03-03 17:26:03 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-03-03 17:26:03 +0000
commit8e25f4449f75fa46ed130a8dc0a20b3744eb61eb (patch)
tree6b445e99cf41c59c4c72c75162d380ae100187fc /Src
parent919f7b12ad4cd6e4b6745e7ea647b9bf0e58c70c (diff)
downloadzsh-8e25f4449f75fa46ed130a8dc0a20b3744eb61eb.tar.gz
zsh-8e25f4449f75fa46ed130a8dc0a20b3744eb61eb.tar.xz
zsh-8e25f4449f75fa46ed130a8dc0a20b3744eb61eb.zip
26675: add POSIX_ALIASES option
Diffstat (limited to 'Src')
-rw-r--r--Src/lex.c6
-rw-r--r--Src/options.c1
-rw-r--r--Src/zsh.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 466447963..f7e87477a 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1748,9 +1748,11 @@ exalias(void)
 
 	if (tok == STRING) {
 	    /* Check for an alias */
-	    if (!noaliases && isset(ALIASESOPT)) {
+	    if (!noaliases && isset(ALIASESOPT) &&
+		(!isset(POSIXALIASES) ||
+		 !reswdtab->getnode(reswdtab, zshlextext))) {
 		char *suf;
-		
+
 		an = (Alias) aliastab->getnode(aliastab, zshlextext);
 		if (an && !an->inuse &&
 		    ((an->node.flags & ALIAS_GLOBAL) || incmdpos || inalmore)) {
diff --git a/Src/options.c b/Src/options.c
index f852ec830..d310f346d 100644
--- a/Src/options.c
+++ b/Src/options.c
@@ -198,6 +198,7 @@ static struct optname optns[] = {
 {{NULL, "octalzeroes",        OPT_EMULATE|OPT_SH},	 OCTALZEROES},
 {{NULL, "overstrike",	      0},			 OVERSTRIKE},
 {{NULL, "pathdirs",	      OPT_EMULATE},		 PATHDIRS},
+{{NULL, "posixaliases",       OPT_EMULATE|OPT_BOURNE},	 POSIXALIASES},
 {{NULL, "posixbuiltins",      OPT_EMULATE|OPT_BOURNE},	 POSIXBUILTINS},
 {{NULL, "posixidentifiers",   OPT_EMULATE|OPT_BOURNE},	 POSIXIDENTIFIERS},
 {{NULL, "printeightbit",      0},                        PRINTEIGHTBIT},
diff --git a/Src/zsh.h b/Src/zsh.h
index 0b9007333..8d2deec6c 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1933,6 +1933,7 @@ enum {
     OCTALZEROES,
     OVERSTRIKE,
     PATHDIRS,
+    POSIXALIASES,
     POSIXBUILTINS,
     POSIXIDENTIFIERS,
     PRINTEIGHTBIT,