diff options
author | vincentdarley <vincentdarley@noemail.net> | 2001-08-23 17:37:07 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2001-08-23 17:37:07 (GMT) |
commit | c27c9fbf8b5c59b5bb7bb4e2a1f590a8f2a2a81f (patch) | |
tree | 6169e1176aad79725e33cee0d99ca91f726feed6 /generic/tclLoad.c | |
parent | 6c8e06a2b0e420dc9f70d164879862ccdc1dd1a2 (diff) | |
download | tcl-c27c9fbf8b5c59b5bb7bb4e2a1f590a8f2a2a81f.zip tcl-c27c9fbf8b5c59b5bb7bb4e2a1f590a8f2a2a81f.tar.gz tcl-c27c9fbf8b5c59b5bb7bb4e2a1f590a8f2a2a81f.tar.bz2 |
fs update
FossilOrigin-Name: 37484c1daabf6ee673956b20a5839e2ba4d36684
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r-- | generic/tclLoad.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 9dd9975..1fdd0b9 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.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: tclLoad.c,v 1.5 2001/07/31 19:12:06 vincentdarley Exp $ + * RCS: @(#) $Id: tclLoad.c,v 1.6 2001/08/23 17:37:08 vincentdarley Exp $ */ #include "tclInt.h" @@ -272,8 +272,10 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) */ retc = TclGuessPackageName(fullFileName, &pkgName); if (!retc) { - int pargc; - char **pargv, *pkgGuess; + Tcl_Obj *splitPtr; + Tcl_Obj *pkgGuessPtr; + int pElements; + char *pkgGuess; /* * The platform-specific code couldn't figure out the @@ -283,8 +285,9 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) * characters that follow that. */ - Tcl_SplitPath(fullFileName, &pargc, &pargv); - pkgGuess = pargv[pargc-1]; + splitPtr = Tcl_FSSplitPath(objv[1], &pElements); + Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr); + pkgGuess = Tcl_GetString(pkgGuessPtr); if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i') && (pkgGuess[2] == 'b')) { pkgGuess += 3; @@ -298,7 +301,7 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) } } if (p == pkgGuess) { - ckfree((char *)pargv); + Tcl_DecrRefCount(splitPtr); Tcl_AppendResult(interp, "couldn't figure out package name for ", fullFileName, (char *) NULL); @@ -306,7 +309,7 @@ Tcl_LoadObjCmd(dummy, interp, objc, objv) goto done; } Tcl_DStringAppend(&pkgName, pkgGuess, (p - pkgGuess)); - ckfree((char *)pargv); + Tcl_DecrRefCount(splitPtr); } } |