Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: trap handling segfault



This patch doesn't crash the snippet I posted, and it prints
BYE after the script in 11735.  I'm going to commit this under the
assumption that someone with a better understanding  will reverse it
if there are horrible side effects.

Index: signals.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/signals.c,v
retrieving revision 1.6
diff -u -r1.6 signals.c
--- signals.c	2000/06/03 16:26:47	1.6
+++ signals.c	2000/06/09 14:35:34
@@ -853,7 +853,7 @@
 	    if (sigtrapped[sig])
 		unsettrap(sig);
 	    sigtrapped[sig] = st->flags;
-	    if (st->flags) {
+	    if (st->flags && (st->list != NULL)) {
 		Eprog prog = (st->flags & ZSIG_FUNC) ?
 		    ((Shfunc) st->list)->funcdef : (Eprog) st->list;
 		/* prevent settrap from saving this */



Messages sorted by: Reverse Date, Date, Thread, Author