1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

remove extra 'isalias' variable (re: 16d5ea9b)

src/cmd/ksh93/bltins/typeset.c: unall():
- There's no need to keep track of whether we're unsetting an alias
  using a new 'isalias' vaariable, as we can just repeat the check
  for 'troot==shp->alias_tree'.

(cherry picked from commit 68f3ae3acd0d19dd80805049a1c9afc1ae1e75c3)
This commit is contained in:
Martijn Dekker 2020-06-09 21:16:14 +02:00
parent 5d50f825e4
commit b883c7a7f8

View file

@ -1161,13 +1161,11 @@ static int unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp)
register const char *name; register const char *name;
volatile int r; volatile int r;
Dt_t *dp; Dt_t *dp;
int nflag=0,all=0,isalias=0,isfun,jmpval; int nflag=0,all=0,isfun,jmpval;
struct checkpt buff; struct checkpt buff;
NOT_USED(argc); NOT_USED(argc);
if(troot==shp->alias_tree) { if(troot==shp->alias_tree)
isalias = 1;
name = sh_optunalias; name = sh_optunalias;
}
else else
name = sh_optunset; name = sh_optunset;
while(r = optget(argv,name)) switch(r) while(r = optget(argv,name)) switch(r)
@ -1302,7 +1300,8 @@ static int unall(int argc, char **argv, register Dt_t *troot, Shell_t* shp)
nv_delete(np,troottmp,0); nv_delete(np,troottmp,0);
} }
/* The alias has been unset by call to _nv_unset, remove it from the tree */ /* The alias has been unset by call to _nv_unset, remove it from the tree */
else if(isalias) { else if(troot==shp->alias_tree)
{
if(nv_isattr(np, NV_NOFREE)) if(nv_isattr(np, NV_NOFREE))
nv_delete(np,troot,NV_NOFREE); /* The alias is in read-only memory (shtab_aliases) */ nv_delete(np,troot,NV_NOFREE); /* The alias is in read-only memory (shtab_aliases) */
else else