mirror of
				git://git.code.sf.net/p/cdesktopenv/code
				synced 2025-03-09 15:50:02 +00:00 
			
		
		
		
	POSIX compliance fix: make 'unalias' a regular builtin
Both 'alias' and 'unalias' are specified as regular builtins. Among a few other things, that means it ought to be portable to use these names for shell functions. But ksh93 disallowed that until now. src/cmd/ksh93/data/builtins.c: - Make 'unalias' a regular builtin by removing the BLT_SPC flag. - (same fix for 'alias' was already done in afa68dca) - Add the BLT_ENV flag to the 'alias' and 'hash' commands. In include/name.h, this flag is commented: "non-stoppable, can modify environment". The "non-stoppable" bit seems like a good idea: these operations should not be interruptable as that would cause an inconsistent state. src/cmd/ksh93/sh.1: - Remove the '-', indicating special builtin, from 'alias' entry. - Minor cosmetic fix: space after the '-' for 'unset'. (cherry picked from commit a4315d7672204acb543010b4d4916b22dcb9cb08)
This commit is contained in:
		
							parent
							
								
									2da22f4023
								
							
						
					
					
						commit
						04b9171858
					
				
					 4 changed files with 15 additions and 9 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue