diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-02-06 20:36:09 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-02-06 20:36:09 +0000 |
commit | 05b06b1c08263af07b2297aac0c842dafca39445 (patch) | |
tree | f64a8e7c40efd43221cfa4bd8f0391e0c993765d /Src/builtin.c | |
parent | 64c2db0ca242269c92fac5cc8637580364c2b6f6 (diff) | |
download | zsh-05b06b1c08263af07b2297aac0c842dafca39445.tar.gz zsh-05b06b1c08263af07b2297aac0c842dafca39445.tar.xz zsh-05b06b1c08263af07b2297aac0c842dafca39445.zip |
fix autoloaded trap bug; rejig use of trapfuncs
(now traplists); improve trap tests
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index 1ccbd6fb8..6fcfabfda 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -2617,14 +2617,12 @@ bin_functions(char *name, char **argv, Options ops, int func) shfunctab->addnode(shfunctab, ztrdup(*argv), shf); if (signum != -1) { - if (settrap(signum, shf->funcdef)) { + if (settrap(signum, NULL, ZSIG_FUNC)) { shfunctab->removenode(shfunctab, *argv); shfunctab->freenode((HashNode)shf); returnval = 1; ok = 0; } - else - sigtrapped[signum] |= ZSIG_FUNC; } if (ok && OPT_ISSET(ops,'X') && @@ -4967,10 +4965,10 @@ bin_trap(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) shfunctab->printnode(hn, 0); DPUTS(!hn, "BUG: I did not find any trap functions!"); } else if (sigtrapped[sig]) { - if (!sigfuncs[sig]) + if (!siglists[sig]) printf("trap -- '' %s\n", sigs[sig]); else { - s = getpermtext(sigfuncs[sig], NULL); + s = getpermtext(siglists[sig], NULL); printf("trap -- "); quotedzputs(s, stdout); printf(" %s\n", sigs[sig]); @@ -5013,7 +5011,7 @@ bin_trap(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) break; } t = dupeprog(prog, 0); - if (settrap(sig, t)) + if (settrap(sig, t, 0)) freeeprog(t); } return *argv != NULL; |