summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c67
1 files changed, 7 insertions, 60 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 9d2637c..2fa93d8 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -87,7 +87,6 @@ typedef struct FsPath {
* epoch. The epoch changes when
* filesystem-mounts are changed. */
const Tcl_Filesystem *fsPtr;/* The Tcl_Filesystem that claims this path */
- Tcl_Encoding encoding;
} FsPath;
/*
@@ -663,18 +662,9 @@ TclPathPart(
* the tail.
*/
- /*
- * We don't know that the encoding of the fileName is the
- * same as the encoding of, but that's on the caller to
- * harmonize. In any case, if the encoding doesn't match
- * at the time it the FsPath object is used, the object is
- * ignored.
- */
-
Tcl_Obj *resultPtr =
- TclNewFSPathObj(fsPathPtr->cwdPtr, fileName,
- (int)(length - strlen(extension)),
- TclFSPathEncoding(interp, fsPathPtr->cwdPtr));
+ TclNewFSPathObj(fsPathPtr->cwdPtr, fileName,
+ (int)(length - strlen(extension)));
Tcl_IncrRefCount(resultPtr);
return resultPtr;
@@ -888,7 +878,6 @@ TclJoinPath(
&& !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))
&& TclGetPathType(elt, NULL, NULL, NULL) == TCL_PATH_ABSOLUTE) {
Tcl_Obj *tailObj = objv[1];
-
Tcl_PathType type;
/* if forceRelative - second path is relative */
@@ -930,17 +919,14 @@ TclJoinPath(
|| (strchr(Tcl_GetString(elt), '\\') == NULL)) {
if (PATHFLAGS(elt)) {
- return TclNewFSPathObj(elt, str, len,
- TclFSPathEncoding(NULL, elt));
+ return TclNewFSPathObj(elt, str, len);
}
if (TCL_PATH_ABSOLUTE != Tcl_FSGetPathType(elt)) {
- return TclNewFSPathObj(
- elt, str, len, TclFSPathEncoding(NULL, elt));
+ return TclNewFSPathObj(elt, str, len);
}
(void) Tcl_FSGetNormalizedPath(NULL, elt);
if (elt == PATHOBJ(elt)->normPathPtr) {
- return TclNewFSPathObj(
- elt, str, len, TclFSPathEncoding(NULL, elt));
+ return TclNewFSPathObj(elt, str, len);
}
}
}
@@ -1272,9 +1258,7 @@ Tcl_Obj *
TclNewFSPathObj(
Tcl_Obj *dirPtr,
const char *addStrRep,
- int len,
- Tcl_Encoding encoding
-)
+ int len)
{
FsPath *fsPathPtr;
Tcl_Obj *pathPtr;
@@ -1320,7 +1304,6 @@ TclNewFSPathObj(
fsPathPtr->nativePathPtr = NULL;
fsPathPtr->fsPtr = NULL;
fsPathPtr->filesystemEpoch = 0;
- fsPathPtr->encoding = encoding;
SETPATHOBJ(pathPtr, fsPathPtr);
PATHFLAGS(pathPtr) = TCLPATH_APPENDED;
@@ -2177,39 +2160,6 @@ TclFSSetPathDetails(
/*
*---------------------------------------------------------------------------
*
- * TclFSPathEncoding --
- *
- * Produce the encoding, if any, associated with a filesystem path.
- *
- * Results:
- * NULL or a valid Tcl_Encoding.
- *
- * Side effects:
- * None.
- *
- *---------------------------------------------------------------------------
- */
-
-Tcl_Encoding
-TclFSPathEncoding(
- Tcl_Interp *interp,
- Tcl_Obj *pathPtr)
-{
- FsPath *fsPathPtr;
- Tcl_Encoding encoding = NULL;
-
- if (Tcl_FSConvertToPathType(interp, pathPtr) != TCL_OK) {
- return NULL;
- }
- if (TclFetchIntRep(pathPtr, &fsPathType)) {
- fsPathPtr = PATHOBJ(pathPtr);
- encoding = fsPathPtr->encoding;
- }
- return encoding;
-}
-/*
- *---------------------------------------------------------------------------
- *
* Tcl_FSEqualPaths --
*
* This function tests whether the two paths given are equal path
@@ -2294,10 +2244,7 @@ SetFsPathFromAny(
Tcl_Obj *transPtr;
const char *name;
- Tcl_Encoding sysencoding = Tcl_GetEncoding(interp, NULL);
-
- if (TclHasIntRep(pathPtr, &fsPathType)
- && TclFSPathEncoding(interp, pathPtr) == sysencoding) {
+ if (TclHasIntRep(pathPtr, &fsPathType)) {
return TCL_OK;
}