From e9c7ac70a73a621a744979ebce6dbea8e5d8829f Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sun, 19 Jul 2020 06:21:14 +0100 Subject: [PATCH] remove unused 'is an exported alias' message (re: 80d9ae2b) Commit 80d9ae2b removed the line that set the NV_EXPORT flag on an alias when the obsolete ksh88 'alias -x' option was used. But it turns out that flag actually did something: it caused 'whence -v' to report the alias as an exported alias -- misleadingly, because exported aliases have never actually exised in ksh93. Since '-x' no longer sets that flag, that message is never printed. src/cmd/ksh93/data/msg.c, src/cmd/ksh93/include/path.h: - Remove is_xalias[] = "%s is an exported alias for " message. src/cmd/ksh93/bltins/whence.c: - Remove dead code to check for (formerly) exported alias. --- src/cmd/ksh93/bltins/whence.c | 5 +---- src/cmd/ksh93/data/msg.c | 1 - src/cmd/ksh93/include/path.h | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/cmd/ksh93/bltins/whence.c b/src/cmd/ksh93/bltins/whence.c index 2fabd5531..1b1a80885 100644 --- a/src/cmd/ksh93/bltins/whence.c +++ b/src/cmd/ksh93/bltins/whence.c @@ -170,10 +170,7 @@ static int whence(Shell_t *shp,char **argv, register int flags) { if(flags&V_FLAG) { - if(nv_isattr(np,NV_EXPORT)) - msg = sh_translate(is_xalias); - else - msg = sh_translate(is_alias); + msg = sh_translate(is_alias); sfprintf(sfstdout,msg,name); } sfputr(sfstdout,sh_fmtq(cp),'\n'); diff --git a/src/cmd/ksh93/data/msg.c b/src/cmd/ksh93/data/msg.c index eb6c94a68..168b216d6 100644 --- a/src/cmd/ksh93/data/msg.c +++ b/src/cmd/ksh93/data/msg.c @@ -138,7 +138,6 @@ const char is_builtin[] = " is a shell builtin"; const char is_spcbuiltin[] = " is a special shell builtin"; const char is_builtver[] = "is a shell builtin version of"; const char is_alias[] = "%s is an alias for "; -const char is_xalias[] = "%s is an exported alias for "; const char is_talias[] = "is a tracked alias for"; const char is_function[] = " is a function"; const char is_ufunction[] = " is an undefined function"; diff --git a/src/cmd/ksh93/include/path.h b/src/cmd/ksh93/include/path.h index 79bf35aa2..481b6040c 100644 --- a/src/cmd/ksh93/include/path.h +++ b/src/cmd/ksh93/include/path.h @@ -127,7 +127,6 @@ extern const char is_spcbuiltin[]; extern const char is_builtver[]; extern const char is_reserved[]; extern const char is_talias[]; -extern const char is_xalias[]; extern const char is_function[]; extern const char is_ufunction[]; #ifdef SHELLMAGIC