mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Make 'source' a regular built-in
The 'source' alias is now converted into a regular built-in command so that 'unalias -a' does not remove it, and something like cmd=source; $cmd name args will now work. This is part of the project to replace default aliases that define essential commands by proper builtins that act identically (except you now get the actual command's name in any error/usage messages). src/cmd/ksh93/data/aliases.c: - Remove 'source' default alias. src/cmd/ksh93/data/builtins.c, src/cmd/ksh93/include/builtins.h: - Define 'source' regular builtin with extra parser ID "SYSSOURCE". Same definition as '.', minus the BLT_SPC flag indicating a special builtin. This preserves the behaviour of 'command .'. - Update sh_optdot[] to include info for 'source --man'. (Note that \f?\f expands to the current command name. This allows several commands to share a single --man page.) src/cmd/ksh93/sh/parse.c: - In the two places that SYSDOT is checked for, also check for SYSSOURCE, making sure the two commands are parsed identically. src/cmd/ksh93/sh.1: - Remove 'source' default alias. - Document 'source' regular builtin.
This commit is contained in:
parent
b7f48e8a10
commit
ef1621c18f
8 changed files with 38 additions and 21 deletions
|
@ -47,9 +47,10 @@
|
|||
#define SYSLET (shgd->bltin_cmds+12) /* let */
|
||||
#define SYSEXPORT (shgd->bltin_cmds+13) /* export */
|
||||
#define SYSDOT (shgd->bltin_cmds+14) /* . */
|
||||
#define SYSRETURN (shgd->bltin_cmds+15) /* return */
|
||||
#define SYSSOURCE (shgd->bltin_cmds+15) /* source */
|
||||
#define SYSRETURN (shgd->bltin_cmds+16) /* return */
|
||||
#if SHOPT_BASH
|
||||
# define SYSLOCAL (shgd->bltin_cmds+16) /* local */
|
||||
# define SYSLOCAL (shgd->bltin_cmds+17) /* local */
|
||||
#else
|
||||
# define SYSLOCAL 0
|
||||
#endif
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#define SH_RELEASE "93u+m 2020-06-14"
|
||||
#define SH_RELEASE "93u+m 2020-06-15"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue