about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fd89cc28..39599afd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-06  Mikael Magnusson  <mikachu@gmail.com>
+
+	* 34114: Src/builtin.c: emulate: Handle aborting from mixed
+	-L/-c correctly
+
 2015-01-06  Barton E. Schaefer  <schaefer@zsh.org>
 
         * 34103: Src/subst.c: fix ancient (workers/15872) thinko that
diff --git a/Src/builtin.c b/Src/builtin.c
index 4a46cbc1f..afa836a03 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5173,7 +5173,7 @@ bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func))
     if (cmd) {
 	if (opt_L) {
 	    zwarnnam("emulate", "option -L incompatible with -c");
-	    goto restore;
+	    goto restore2;
 	}
 	*--argv = cmd;	/* on stack, never free()d, see execbuiltin() */
     } else
@@ -5211,6 +5211,7 @@ bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func))
     }
     ret = eval(argv);
     sticky = save_sticky;
+restore2:
     emulation = saveemulation;
     memcpy(opts, saveopts, sizeof(opts));
     restorepatterndisables(savepatterns);