diff --git a/NEWS b/NEWS index 284856f85..d566e561b 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,12 @@ For full details, see the git log at: Any uppercase BUG_* names are modernish shell bug IDs. +2020-06-11: + +- POSIX compliance fix: It is now possible to set shell functions named + 'alias' or 'unalias', overriding the commands by the same names. In + technical terms, they are now regular builtins, not special builtins. + 2020-06-10: - The 'hash' utility is now a regular builtin instead of an alias to diff --git a/src/cmd/ksh93/data/builtins.c b/src/cmd/ksh93/data/builtins.c index f426da7f5..e2497b5b2 100644 --- a/src/cmd/ksh93/data/builtins.c +++ b/src/cmd/ksh93/data/builtins.c @@ -56,7 +56,7 @@ */ const struct shtable3 shtab_builtins[] = { - "login", NV_BLTIN|BLT_ENV|BLT_SPC, Bltin(login), + "login", NV_BLTIN|BLT_ENV, Bltin(login), "exec", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(exec), "set", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(set), ":", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(true), @@ -76,11 +76,11 @@ const struct shtable3 shtab_builtins[] = "local", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset), #endif #if _bin_newgrp || _usr_bin_newgrp - "newgrp", NV_BLTIN|BLT_ENV|BLT_SPC, Bltin(login), + "newgrp", NV_BLTIN|BLT_ENV, Bltin(login), #endif /* _bin_newgrp || _usr_bin_newgrp */ - "alias", NV_BLTIN, bltin(alias), - "hash", NV_BLTIN, bltin(alias), - "enum", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(enum), + "alias", NV_BLTIN|BLT_ENV, bltin(alias), + "hash", NV_BLTIN|BLT_ENV, bltin(alias), + "enum", NV_BLTIN|BLT_ENV|BLT_DCL, bltin(enum), "eval", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_EXIT,bltin(eval), "exit", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(return), "fc", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(hist), @@ -88,7 +88,7 @@ const struct shtable3 shtab_builtins[] = "readonly", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly), "shift", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(shift), "trap", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(trap), - "unalias", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(unalias), + "unalias", NV_BLTIN|BLT_ENV, bltin(unalias), "unset", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(unset), "builtin", NV_BLTIN, bltin(builtin), #if SHOPT_ECHOPRINT diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index 3cb591b26..3a34904ff 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -17,4 +17,4 @@ * David Korn * * * ***********************************************************************/ -#define SH_RELEASE "93u+m 2020-06-10" +#define SH_RELEASE "93u+m 2020-06-11" diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 63899beac..13af163c9 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -7738,7 +7738,7 @@ option causes the mode to be printed as a symbolic value. Otherwise, the mask is printed in octal. .TP -\(dg \f3unalias\fP \*(OK \f3\-a\fP \*(CK \f2name\^\fP .\|.\|. +\f3unalias\fP \*(OK \f3\-a\fP \*(CK \f2name\^\fP .\|.\|. The aliases given by the list of .IR name s @@ -7748,7 +7748,7 @@ The option causes all the aliases to be unset. .TP -\(dg\f3unset\fP \*(OK \f3\-fnv\fP \*(CK \f2vname\^\fP .\|.\|. +\(dg \f3unset\fP \*(OK \f3\-fnv\fP \*(CK \f2vname\^\fP .\|.\|. The variables given by the list of .IR vname s are unassigned,