about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-07-24 14:01:54 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-07-24 14:01:54 +0000
commit14810d6df13e0564a606b74e4c4e918e80862e25 (patch)
tree0e24a6c6b0226a90bdf8398ce94b60fdc9a87b0e /Src/exec.c
parentd6d4a3abfc84f0940e663cd69537789a039a7056 (diff)
downloadzsh-dot-zsh-199907241534.tar.gz
zsh-dot-zsh-199907241534.tar.xz
zsh-dot-zsh-199907241534.zip
zsh-3.1.6-test-3 dot-zsh-199907241534
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index dc281675f..eab846540 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2922,7 +2922,7 @@ doshfunc(char *name, List list, LinkList doshargs, int flags, int noreturnval)
 
 	tab = pparams;
 	oldscriptname = scriptname;
-	scriptname = name;
+	scriptname = dupstring(name);
 	oldzoptind = zoptind;
 	zoptind = 1;
 
@@ -3145,6 +3145,7 @@ cancd2(char *s)
 {
     struct stat buf;
     char *us, *us2 = NULL;
+    int ret;
 
     /*
      * If CHASEDOTS and CHASELINKS are not set, we want to rationalize the
@@ -3159,9 +3160,10 @@ cancd2(char *s)
 	fixdir(us2 = us);
     } else
 	us = unmeta(s);
-    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
+    ret = !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
     if (us2)
 	free(us2);
+    return ret;
 }
 
 /**/