mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
c6c87f2a18
commit
0a315e79df
1 changed files with 16 additions and 0 deletions
|
|
@ -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 a new issue