diff options
| author | dgp <dgp@users.sourceforge.net> | 2015-08-27 11:48:03 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2015-08-27 11:48:03 (GMT) |
| commit | 62addcfa82fc1bb884fa6a7d643a2fab0870487b (patch) | |
| tree | 846a0302bd00e43df73e18bd4ba1fc508162a177 /unix/tclUnixFile.c | |
| parent | 57e43137bdb2bda8f829c945bf12312b0555f1e6 (diff) | |
| parent | f08cbe00fd1ac3c0a36e15bcc98778d4c5c12679 (diff) | |
| download | tcl-62addcfa82fc1bb884fa6a7d643a2fab0870487b.zip tcl-62addcfa82fc1bb884fa6a7d643a2fab0870487b.tar.gz tcl-62addcfa82fc1bb884fa6a7d643a2fab0870487b.tar.bz2 | |
merge 8.5
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 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); |
