summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-09-08 13:01:31 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-09-08 13:01:31 (GMT)
commitfa105712c19ab4f84d85f6e33cb51a85e2ad259f (patch)
treea7a9bb771e8cb47db9ba5834f8790aa617861bf5 /unix/tclUnixFile.c
parentd2c080833061d96d6d76d4d3873e15796cdd815c (diff)
parent600412a708fa193015ef5e22f66d6d4ceee741cc (diff)
downloadtcl-fa105712c19ab4f84d85f6e33cb51a85e2ad259f.zip
tcl-fa105712c19ab4f84d85f6e33cb51a85e2ad259f.tar.gz
tcl-fa105712c19ab4f84d85f6e33cb51a85e2ad259f.tar.bz2
merge 8.6.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 2cb0027..7ffbf8d 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);