summaryrefslogtreecommitdiffstats
path: root/generic/tclLoad.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2001-08-23 17:37:07 (GMT)
committervincentdarley <vincentdarley>2001-08-23 17:37:07 (GMT)
commitf319c32167c2c52995fe53b438ef4bc34e9a4914 (patch)
tree6169e1176aad79725e33cee0d99ca91f726feed6 /generic/tclLoad.c
parent8d4c60866a8f603ab29fa193c8f4aff83f8beee7 (diff)
downloadtcl-f319c32167c2c52995fe53b438ef4bc34e9a4914.zip
tcl-f319c32167c2c52995fe53b438ef4bc34e9a4914.tar.gz
tcl-f319c32167c2c52995fe53b438ef4bc34e9a4914.tar.bz2
fs update
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r--generic/tclLoad.c17
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);
}
}