about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/hashtable.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c
index bc2a4f22e..e12aca852 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -819,8 +819,10 @@ disableshfuncnode(HashNode hn, UNUSED(int flags))
     hn->flags |= DISABLED;
     if (!strncmp(hn->nam, "TRAP", 4)) {
 	int signum = getsignum(hn->nam + 4);
-	sigtrapped[signum] &= ~ZSIG_FUNC;
-	unsettrap(signum);
+	if (signum != -1) {
+	    sigtrapped[signum] &= ~ZSIG_FUNC;
+	    unsettrap(signum);
+	}
     }
 }