diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-08-25 14:07:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-08-25 14:07:11 (GMT) |
commit | 6e584734274ae6286fa7bdf4b14667b673ea68a0 (patch) | |
tree | 198d06f68805ded1e3198b14e62243835ab9b1ed /unix/tclUnixFile.c | |
parent | 023624c3c93c61c06e6b5a70f6f86ae0105cadf3 (diff) | |
parent | 570eb6b10d4d79e67bbca7dc36edceed219b8308 (diff) | |
download | tcl-6e584734274ae6286fa7bdf4b14667b673ea68a0.zip tcl-6e584734274ae6286fa7bdf4b14667b673ea68a0.tar.gz tcl-6e584734274ae6286fa7bdf4b14667b673ea68a0.tar.bz2 |
merge trunk
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 7 |
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); |