1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 15:01:21 +02:00

22997: fix ${...?...} exit and traps

This commit is contained in:
Peter Stephenson 2006-11-11 13:16:10 +00:00
parent 254b3f1a6b
commit b09a7cc5bf
3 changed files with 22 additions and 2 deletions

@ -1,3 +1,9 @@
2006-11-11 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 22997: Src/builtin.c, Src/subst.c: ${...?...} didn't go through
proper exit sequence and didn't take account of being in a
subshell and didn't call exit trap anyway because errflag was set.
2006-11-10 Peter Stephenson <pws@csr.com>
* 22993: Completion/Unix/Command/_make: slightly more

@ -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 */

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