Fix how /bin/sh handles 'for' and 'case' statements when it is called to do
errexit (-e) processing. This solves a problem where 'make clean' would fail with an unspecified error in certain automake-generated makefiles. Reviewed by: no objections from -hackers... MFC after: 2 weeks
This commit is contained in:
parent
5eae83e2d8
commit
1246730a2a
@ -249,9 +249,25 @@ evaltree(n, flags)
|
||||
break;
|
||||
case NFOR:
|
||||
evalfor(n);
|
||||
/*
|
||||
* The 'for' command does not set exitstatus, so the value
|
||||
* now in exitstatus is from the last command executed in
|
||||
* the 'for' loop. That exit value had been tested (wrt
|
||||
* 'sh -e' checking) while processing that command, and
|
||||
* it should not be re-tested here.
|
||||
*/
|
||||
flags |= EV_TESTED;
|
||||
break;
|
||||
case NCASE:
|
||||
evalcase(n, flags);
|
||||
/*
|
||||
* The 'case' command does not set exitstatus, so the value
|
||||
* now in exitstatus is from the last command executed in
|
||||
* the 'case' block. That exit value had been tested (wrt
|
||||
* 'sh -e' checking) while processing that command, and
|
||||
* it should not be re-tested here.
|
||||
*/
|
||||
flags |= EV_TESTED;
|
||||
break;
|
||||
case NDEFUN:
|
||||
defun(n->narg.text, n->narg.next);
|
||||
|
Loading…
Reference in New Issue
Block a user