diff options
Diffstat (limited to 'unix/tclUnixTest.c')
-rw-r--r-- | unix/tclUnixTest.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c index 9b5c717..8cdf7c7 100644 --- a/unix/tclUnixTest.c +++ b/unix/tclUnixTest.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTest.c,v 1.19 2004/11/30 19:34:51 dgp Exp $ + * RCS: @(#) $Id: tclUnixTest.c,v 1.20 2004/12/01 23:18:55 dgp Exp $ */ #include "tclInt.h" @@ -426,7 +426,7 @@ TestfilewaitCmd(clientData, interp, argc, argv) * TestfindexecutableCmd -- * * This procedure implements the "testfindexecutable" command. It is - * used to test Tcl_FindExecutable. + * used to test TclpFindExecutable. * * Results: * A standard Tcl result. @@ -444,8 +444,7 @@ TestfindexecutableCmd(clientData, interp, argc, argv) int argc; /* Number of arguments. */ CONST char **argv; /* Argument strings. */ { - char *oldNativeName; - int oldDone; + Tcl_Obj *saveName; if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], @@ -453,22 +452,14 @@ TestfindexecutableCmd(clientData, interp, argc, argv) return TCL_ERROR; } - oldNativeName = tclNativeExecutableName; - oldDone = tclFindExecutableSearchDone; + saveName = TclGetObjNameOfExecutable(); + Tcl_IncrRefCount(saveName); - tclNativeExecutableName = NULL; - tclFindExecutableSearchDone = 0; - - Tcl_GetNameOfExecutable(); - Tcl_FindExecutable(argv[1]); - Tcl_SetResult(interp, (char *) Tcl_GetNameOfExecutable(), TCL_VOLATILE); - if (tclNativeExecutableName != NULL) { - ckfree(tclNativeExecutableName); - } - - tclNativeExecutableName = oldNativeName; - tclFindExecutableSearchDone = oldDone; + TclpFindExecutable(argv[1]); + Tcl_SetObjResult(interp, TclGetObjNameOfExecutable()); + TclSetObjNameOfExecutable(saveName, NULL); + Tcl_DecrRefCount(saveName); return TCL_OK; } |