mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Merge pull request #1 from JohnoKing/fix-builtin-delete
`builtin -d` should not delete special builtins
This commit is contained in:
commit
e500479ede
3 changed files with 12 additions and 0 deletions
|
@ -1203,6 +1203,8 @@ Namval_t *sh_addbuiltin(const char *path, Shbltin_f bltin, void *extra)
|
|||
stakseek(offset);
|
||||
if(extra == (void*)1)
|
||||
{
|
||||
if(nv_isattr(np,BLT_SPC))
|
||||
errormsg(SH_DICT,ERROR_exit(1),"cannot delete: %s%s",name,is_spcbuiltin);
|
||||
if(np->nvfun && !nv_isattr(np,NV_NOFREE))
|
||||
free((void*)np->nvfun);
|
||||
dtdelete(sh.bltin_tree,np);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue