diff options
author | cracauer <cracauer@FreeBSD.org> | 1998-05-04 07:24:10 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 1998-05-04 07:24:10 +0000 |
commit | 5b12149227a866bd135ba0a7a4562f7693e50f65 (patch) | |
tree | 24495d095b72b1f6d4dcbb1646d2746fbe8a560e /bin/sh | |
parent | 13c4d191943ddcfe735046d55d96f0a330b9fedb (diff) | |
download | FreeBSD-src-5b12149227a866bd135ba0a7a4562f7693e50f65.zip FreeBSD-src-5b12149227a866bd135ba0a7a4562f7693e50f65.tar.gz |
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.
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/eval.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index acf21f6..0e6d86c 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -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(); |