about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2017-04-15 21:16:11 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2017-04-15 21:16:11 -0700
commitfc96274801f38f20063c904e0eaa98a23ee2e74c (patch)
treeb65bee3f12ec0f42a63fb0a14234922c1705da62 /Src
parenta11b241d4a5ec7ee1009905372cf32fb4538fbb3 (diff)
downloadzsh-fc96274801f38f20063c904e0eaa98a23ee2e74c.tar.gz
zsh-fc96274801f38f20063c904e0eaa98a23ee2e74c.tar.xz
zsh-fc96274801f38f20063c904e0eaa98a23ee2e74c.zip
40977: "emulate" disallows "--help" and "--version"
Diffstat (limited to 'Src')
-rw-r--r--Src/init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/init.c b/Src/init.c
index a1162b318..d8c26aca2 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -376,12 +376,12 @@ parseopts(char *nam, char ***argvp, char *new_opts, char **cmdp,
 	    *argv = "--";
 	while (*++*argv) {
 	    if (**argv == '-') {
-		if(!argv[0][1]) {
+		if (!argv[0][1]) {
 		    /* The pseudo-option `--' signifies the end of options. */
 		    argv++;
 		    goto doneoptions;
 		}
-		if(*argv != args+1 || **argv != '-')
+		if (nam || *argv != args+1 || **argv != '-')
 		    goto badoptionstring;
 		/* GNU-style long options */
 		++*argv;