summaryrefslogtreecommitdiff
path: root/Src/hashtable.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/hashtable.c')
-rw-r--r--Src/hashtable.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c
index b4c0a573b..3595c2721 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -788,12 +788,12 @@ removeshfuncnode(HashTable ht, char *nam)
{
HashNode hn;
- if ((hn = removehashnode(shfunctab, nam))) {
- if (!strncmp(hn->nam, "TRAP", 4))
- unsettrap(getsignum(hn->nam + 4));
- return hn;
- } else
- return NULL;
+ if (!strncmp(nam, "TRAP", 4))
+ hn = removetrap(getsignum(nam + 4));
+ else
+ hn = removehashnode(shfunctab, nam);
+
+ return hn;
}
/* Disable an entry in the shell function hash table. *
@@ -822,11 +822,10 @@ static void
enableshfuncnode(HashNode hn, int flags)
{
Shfunc shf = (Shfunc) hn;
- int signum;
shf->flags &= ~DISABLED;
if (!strncmp(shf->nam, "TRAP", 4)) {
- signum = getsignum(shf->nam + 4);
+ int signum = getsignum(shf->nam + 4);
if (signum != -1) {
settrap(signum, shf->funcdef);
sigtrapped[signum] |= ZSIG_FUNC;