When calling a shell function, remember whether exit status is tested.

This is needed for the '-e' option. See the PR for more details.
PR:		6047
Reviewed by:	PR submitter, silence on review request.
This commit is contained in:
Martin Cracauer 1998-05-04 07:24:10 +00:00
parent e48cb40581
commit 686ed44763
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35675

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: eval.c,v 1.12 1997/04/28 03:06:33 steve Exp $
* $Id: eval.c,v 1.13 1997/05/19 00:18:36 steve Exp $
*/
#ifndef lint
@ -764,7 +764,10 @@ evalcommand(cmd, flags, backcmd)
for (sp = varlist.list ; sp ; sp = sp->next)
mklocal(sp->text);
funcnest++;
evaltree(cmdentry.u.func, 0);
if (flags & EV_TESTED)
evaltree(cmdentry.u.func, EV_TESTED);
else
evaltree(cmdentry.u.func, 0);
funcnest--;
INTOFF;
poplocalvars();