mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Load 'r' and 'history' default aliases on interactive only
These two default aliases are useful on interactive shells. In scripts, they interfere with possible function or command names. As of this commit, these final two default aliases are only loaded for interactive shells, leaving zero default aliases for scripts. This completes the project to get rid of misguided default aliases. src/cmd/ksh93/include/shtable.h, src/cmd/ksh93/data/aliases.c: src/cmd/ksh93/sh/init.c: - Add empty alias table shtab_noaliases[] for scripts. - Rename inittree() to sh_inittree() and make it external. - nv_init(), sh_reinit(): Initialise empty alias tree for scripts. src/cmd/ksh93/sh/main.c: sh_main(): - If interactive, reinitialise alias tree for interactive shells. src/cmd/ksh93/tests/alias.sh: - To test default alias removal, launch shell with -i.
This commit is contained in:
parent
a42ac7e77a
commit
17f81ebedb
7 changed files with 23 additions and 29 deletions
|
@ -24,7 +24,7 @@
|
|||
#include "FEATURE/dynamic"
|
||||
|
||||
/*
|
||||
* This is the table of built-in aliases. These should be exported.
|
||||
* Table of built-in aliases for interactive shells.
|
||||
*/
|
||||
|
||||
const struct shtable2 shtab_aliases[] =
|
||||
|
@ -34,3 +34,12 @@ const struct shtable2 shtab_aliases[] =
|
|||
"", 0, (char*)0
|
||||
};
|
||||
|
||||
/*
|
||||
* Empty table of built-in aliases for non-interactive shells.
|
||||
*/
|
||||
|
||||
const struct shtable2 shtab_noaliases[] =
|
||||
{
|
||||
"", 0, (char*)0
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue