summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-09-23 16:37:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-09-23 16:37:06 (GMT)
commitf2a99f616709067279365602e55550e6ffcac3f1 (patch)
tree96bb15abcaf084d545a65c64ebc9da85434da8ae /unix/tclUnixFile.c
parent32a9dde838b7ced5b5cb367c0e73a2d02d7f9f21 (diff)
parent049bb5ecaaf93243a92873e5d1f10bfefcba5ba0 (diff)
downloadtcl-f2a99f616709067279365602e55550e6ffcac3f1.zip
tcl-f2a99f616709067279365602e55550e6ffcac3f1.tar.gz
tcl-f2a99f616709067279365602e55550e6ffcac3f1.tar.bz2
merge 8.5
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r--unix/tclUnixFile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index c5f75a7..0a2099c 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -155,6 +155,11 @@ TclpFindExecutable(
goto done;
}
+ if (TclpGetCwd(NULL, &cwd) == NULL) {
+ TclSetObjNameOfExecutable(Tcl_NewObj(), NULL);
+ goto done;
+ }
+
/*
* The name is relative to the current working directory. First strip off
* a leading "./", if any, then add the full path name of the current
@@ -168,8 +173,6 @@ TclpFindExecutable(
Tcl_DStringInit(&nameString);
Tcl_DStringAppend(&nameString, name, -1);
- TclpGetCwd(NULL, &cwd);
-
Tcl_DStringFree(&buffer);
Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&cwd),
Tcl_DStringLength(&cwd), &buffer);