From 84963428416ba7cd8518d82b1899178178dfc1b4 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 29 Apr 2000 06:33:48 +0000 Subject: 11015: `unfunction TRAPxxx' now works with localtraps in effect. I'm not very happy with having to play with `noerrs' but I don't see any other way to silence the warning from bin_unhash(). --- Src/hashtable.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Src/hashtable.c') 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; -- cgit 1.4.1