about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-06-01 15:01:37 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-06-01 15:01:37 -0700
commit19f3161e51dc880093cb71584f75b77a6084d52e (patch)
tree4a33e447de32eb47ff640ffd4dea9f711d8e8539 /Src/init.c
parent10ae77c0cfee1e15fe062ee5a6d8a4b31304d58a (diff)
downloadzsh-19f3161e51dc880093cb71584f75b77a6084d52e.tar.gz
zsh-19f3161e51dc880093cb71584f75b77a6084d52e.tar.xz
zsh-19f3161e51dc880093cb71584f75b77a6084d52e.zip
32634: add POSIX_ARGZERO option
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/init.c b/Src/init.c
index fd12412c7..5e92f59df 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -226,7 +226,7 @@ parseargs(char **argv, char **runscript)
     char **x;
     LinkList paramlist;
 
-    argzero = *argv++;
+    argzero = posixzero = *argv++;
     SHIN = 0;
 
     /* There's a bit of trickery with opts[INTERACTIVE] here.  It starts *
@@ -253,7 +253,7 @@ parseargs(char **argv, char **runscript)
     if (*argv) {
 	if (unset(SHINSTDIN)) {
 	    if (cmd)
-		argzero = *argv;
+		argzero = posixzero = *argv;
 	    else
 		*runscript = *argv;
 	    opts[INTERACTIVE] &= 1;
@@ -275,6 +275,7 @@ parseargs(char **argv, char **runscript)
     while ((*x++ = (char *)getlinknode(paramlist)));
     free(paramlist);
     argzero = ztrdup(argzero);
+    posixzero = ztrdup(posixzero);
 }
 
 /* Insert into list in order of pointer value */