about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorAndrey Borzenkov <bor@users.sourceforge.net>2008-08-31 15:59:13 +0000
committerAndrey Borzenkov <bor@users.sourceforge.net>2008-08-31 15:59:13 +0000
commitd19602a65a0fa7c42aacbbedbd0d9e44d52055ba (patch)
tree7cff5e8aa63455710a0bcb5200485b1e607e4a96 /Src
parentf18f231ef7eb73ebe0c4e3dec41255924af15e61 (diff)
downloadzsh-d19602a65a0fa7c42aacbbedbd0d9e44d52055ba.tar.gz
zsh-d19602a65a0fa7c42aacbbedbd0d9e44d52055ba.tar.xz
zsh-d19602a65a0fa7c42aacbbedbd0d9e44d52055ba.zip
users/13169: really restore emulation mode after 'emulate -L'
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c4
1 files changed, 3 insertions, 1 deletions
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];