summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-11-11 13:16:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-11-11 13:16:10 +0000
commitb09a7cc5bfa0cca9eff94d5fcdd40ea611001f3c (patch)
tree87254ce597a07b88aaaa274d44296f1a1ac55dd7 /Src
parent254b3f1a6b85e6cfefe21fea3d81c3f97c003ec2 (diff)
downloadzsh-b09a7cc5bfa0cca9eff94d5fcdd40ea611001f3c.tar.gz
zsh-b09a7cc5bfa0cca9eff94d5fcdd40ea611001f3c.tar.xz
zsh-b09a7cc5bfa0cca9eff94d5fcdd40ea611001f3c.zip
22997: fix ${...?...} exit and traps
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c5
-rw-r--r--Src/subst.c13
2 files changed, 16 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 85c961e3d..e567675ff 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -4413,6 +4413,11 @@ zexit(int val, int from_where)
      * indicate we shouldn't do any recursive processing.
      */
     in_exit = -1;
+    /*
+     * We want to do all remaining processing regardless of preceeding
+     * errors.
+     */
+    errflag = 0;
 
     if (isset(MONITOR)) {
 	/* send SIGHUP to any jobs left running  */
diff --git a/Src/subst.c b/Src/subst.c
index 06e16c183..5e41beff1 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2591,8 +2591,17 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 	    if (vunset) {
 		*idend = '\0';
 		zerr("%s: %s", idbeg, *s ? s : "parameter not set");
-		if (!interact)
-		    exit(1);
+		if (!interact) {
+		    if (mypid == getpid()) {
+			/*
+			 * paranoia: don't check for jobs, but there shouldn't
+			 * be any if not interactive.
+			 */
+			stopmsg = 1;
+			zexit(1, 0);
+		    } else
+			_exit(1);
+		}
 		return NULL;
 	    }
 	    break;