Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH 01/17: emulate: Handle aborting from mixed -L/-c correctly



Somehow Coverity found this (Issue 1255797, Failure to restore non-local value).
---
 Src/builtin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Src/builtin.c b/Src/builtin.c
index ebc0654..2b9c4de 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5171,7 +5171,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
@@ -5209,6 +5209,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);
-- 
2.2.0.GIT



Messages sorted by: Reverse Date, Date, Thread, Author