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

PATCH: Better fix for st->list == NULL in endtrapscope()



This replaces 11839, but it doesn't do anything for 11854.

Index: Src/signals.c
===================================================================
@@ -669,7 +669,8 @@
 	    newshf->nam = ztrdup(shf->nam);
 	    newshf->flags = shf->flags;
 	    newshf->funcdef = dupeprog(shf->funcdef, 0);
-	}
+	} else
+	    st->flags &= ~ZSIG_FUNC;
 	st->list = newshf;
     } else {
 	st->list = sigfuncs[sig] ? dupeprog(sigfuncs[sig], 0) : NULL;
@@ -853,7 +854,7 @@
 	    if (sigtrapped[sig])
 		unsettrap(sig);
 	    sigtrapped[sig] = st->flags;
-	    if (st->flags && (st->list != NULL)) {
+	    if (st->flags) {
 		Eprog prog = (st->flags & ZSIG_FUNC) ?
 		    ((Shfunc) st->list)->funcdef : (Eprog) st->list;
 		/* prevent settrap from saving this */

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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