summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-22 08:20:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-22 08:20:03 (GMT)
commit5420a19e5c690cb9c96babceac44c26ff6f2167d (patch)
tree09d42b476605f7860fbaebb136d4f8e144f14159 /unix/tclUnixFile.c
parent68d8dd01a2433624b814b9b3fa5a2a7438d4e547 (diff)
parent256865fe128c764644470f0250d960bdf1d51925 (diff)
downloadtcl-5420a19e5c690cb9c96babceac44c26ff6f2167d.zip
tcl-5420a19e5c690cb9c96babceac44c26ff6f2167d.tar.gz
tcl-5420a19e5c690cb9c96babceac44c26ff6f2167d.tar.bz2
merge trunk
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);