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

PATCH (?): Debug trap bug?



Can anybody tell me how the code before this patch could be right, or why
this patch would be wrong?  If not, I'll commit it to both trunk and branch.

Index: Src/exec.c
===================================================================
--- Src/exec.c	2001/09/24 15:40:12	1.10
+++ Src/exec.c	2001/10/11 16:36:32
@@ -886,11 +886,18 @@
 	state->pc--;
 sublist_done:
 
-	cmdsp = csp;
 	noerrexit = oldnoerrexit;
 
-	if (sigtrapped[SIGDEBUG])
+	if (sigtrapped[SIGDEBUG]) {
+	    exiting = donetrap;
+	    ret = lastval;
 	    dotrap(SIGDEBUG);
+	    lastval = ret;
+	    donetrap = exiting;
+	    noerrexit = oldnoerrexit;
+	}
+
+	cmdsp = csp;
 
 	/* Check whether we are suppressing traps/errexit *
 	 * (typically in init scripts) and if we haven't  *

-- 
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