about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-10 09:28:43 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-10 09:28:43 +0000
commitbc3256997b737f6158e9768dcf5738a7c0fbb454 (patch)
tree0a2d6b73c8c114649549c6d49145e45ada9fb46e /Src/exec.c
parentdbdf7e33a17e1f2dfee689190340590979271635 (diff)
downloadzsh-bc3256997b737f6158e9768dcf5738a7c0fbb454.tar.gz
zsh-bc3256997b737f6158e9768dcf5738a7c0fbb454.tar.xz
zsh-bc3256997b737f6158e9768dcf5738a7c0fbb454.zip
zsh-workers/7765
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 720620e71..3e44adfc2 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2918,7 +2918,7 @@ doshfunc(char *name, List list, LinkList doshargs, int flags, int noreturnval)
  * was executed.                                            */
 {
     char **tab, **x, *oargv0 = NULL;
-    int oldzoptind, oldlastval;
+    int oldzoptind, oldlastval, oldoptcind;
     char saveopts[OPT_SIZE], *oldscriptname;
     int obreaks = breaks;
 
@@ -2935,6 +2935,8 @@ doshfunc(char *name, List list, LinkList doshargs, int flags, int noreturnval)
 	scriptname = dupstring(name);
 	oldzoptind = zoptind;
 	zoptind = 1;
+	oldoptcind = optcind;
+	optcind = 0;
 
 	/* We need to save the current options even if LOCALOPTIONS is *
 	 * not currently set.  That's because if it gets set in the    *
@@ -2974,6 +2976,7 @@ doshfunc(char *name, List list, LinkList doshargs, int flags, int noreturnval)
 	    zsfree(argzero);
 	    argzero = oargv0;
 	}
+	optcind = oldoptcind;
 	zoptind = oldzoptind;
 	scriptname = oldscriptname;
 	pparams = tab;