diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2000-04-29 06:33:48 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2000-04-29 06:33:48 +0000 |
commit | 84963428416ba7cd8518d82b1899178178dfc1b4 (patch) | |
tree | 9f1d9e386bdb244601548e75031c707a5bc38fdf /Src/hashtable.c | |
parent | b7e5949279a4c5f08a8c1460345c05cdb193f5eb (diff) | |
download | zsh-84963428416ba7cd8518d82b1899178178dfc1b4.tar.gz zsh-84963428416ba7cd8518d82b1899178178dfc1b4.tar.xz zsh-84963428416ba7cd8518d82b1899178178dfc1b4.zip |
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().
Diffstat (limited to 'Src/hashtable.c')
-rw-r--r-- | Src/hashtable.c | 15 |
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; |