From d19602a65a0fa7c42aacbbedbd0d9e44d52055ba Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sun, 31 Aug 2008 15:59:13 +0000 Subject: users/13169: really restore emulation mode after 'emulate -L' --- Src/exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index aef97b216..e9f4bc1e8 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4184,7 +4184,7 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval) int oldzoptind, oldlastval, oldoptcind, oldnumpipestats, ret; int *oldpipestats = NULL; char saveopts[OPT_SIZE], *oldscriptname = scriptname, *fname = dupstring(name); - int obreaks; + int obreaks, saveemulation ; struct funcstack fstack; #ifdef MAX_FUNCTION_DEPTH static int funcdepth; @@ -4223,6 +4223,7 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval) * not currently set. That's because if it gets set in the * * function we need to restore the original options on exit. */ memcpy(saveopts, opts, sizeof(opts)); + saveemulation = emulation; if (flags & PM_TAGGED) opts[XTRACE] = 1; @@ -4315,6 +4316,7 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval) saveopts[PRIVILEGED] = opts[PRIVILEGED]; saveopts[RESTRICTED] = opts[RESTRICTED]; memcpy(opts, saveopts, sizeof(opts)); + emulation = saveemulation; } else { /* just restore a couple. */ opts[XTRACE] = saveopts[XTRACE]; -- cgit 1.4.1