diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-24 07:57:54 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-24 07:57:54 (GMT) |
commit | c3353d5a645c33f35445ab3c510dfef988897dd2 (patch) | |
tree | e324bac995b3095c40458e48569929c2510e65e1 /generic | |
parent | 710734302bdc7b1230d0de70b5fed5ccdaffa4bd (diff) | |
parent | 5837fdc42cd33f9b1f81bc4f75b9dad62b0631b2 (diff) | |
download | tcl-c3353d5a645c33f35445ab3c510dfef988897dd2.zip tcl-c3353d5a645c33f35445ab3c510dfef988897dd2.tar.gz tcl-c3353d5a645c33f35445ab3c510dfef988897dd2.tar.bz2 |
Backout [0f2870649c804dd8], since testcase encoding-2.2 fails
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclFileName.c | 6 | ||||
-rw-r--r-- | generic/tclIOUtil.c | 4 | ||||
-rw-r--r-- | generic/tclInt.h | 8 | ||||
-rw-r--r-- | generic/tclPathObj.c | 67 |
4 files changed, 11 insertions, 74 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 053812e..3419d7c 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -2437,8 +2437,7 @@ DoGlob( joinedPtr = TclDStringToObj(&append); } else if (flags) { joinedPtr = TclNewFSPathObj(pathPtr, Tcl_DStringValue(&append), - Tcl_DStringLength(&append), - TclFSPathEncoding(interp, pathPtr)); + Tcl_DStringLength(&append)); } else { joinedPtr = Tcl_DuplicateObj(pathPtr); if (strchr(separators, Tcl_DStringValue(&append)[0]) == NULL) { @@ -2471,8 +2470,7 @@ DoGlob( if (pathPtr == NULL) { joinedPtr = Tcl_NewStringObj(pattern, p-pattern); } else if (flags) { - joinedPtr = TclNewFSPathObj(pathPtr, pattern, p-pattern, - TclFSPathEncoding(interp, pathPtr)); + joinedPtr = TclNewFSPathObj(pathPtr, pattern, p-pattern); } else { joinedPtr = Tcl_DuplicateObj(pathPtr); if (strchr(separators, pattern[0]) == NULL) { diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index ba9c6bc..3773159 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1225,9 +1225,7 @@ FsAddMountsToGlobResult( len--; } len++; /* account for '/' in the mElt [Bug 1602539] */ - - mElt = TclNewFSPathObj(pathPtr, mount + len, mlen - len - , TclFSPathEncoding(NULL, pathPtr)); + mElt = TclNewFSPathObj(pathPtr, mount + len, mlen - len); Tcl_ListObjAppendElement(NULL, resultPtr, mElt); } /* diff --git a/generic/tclInt.h b/generic/tclInt.h index ddc58d6..1fe3822 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3009,12 +3009,6 @@ MODULE_SCOPE double TclFloor(const mp_int *a); MODULE_SCOPE void TclFormatNaN(double value, char *buffer); MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr, const char *attributeName, int *indexPtr); -MODULE_SCOPE - Tcl_Encoding TclFSPathEncoding( - Tcl_Interp *interp, - Tcl_Obj *pathPtr - ); - MODULE_SCOPE Tcl_Command TclNRCreateCommandInNs(Tcl_Interp *interp, const char *cmdName, Tcl_Namespace *nsPtr, Tcl_ObjCmdProc *proc, Tcl_ObjCmdProc *nreProc, @@ -3138,7 +3132,7 @@ MODULE_SCOPE int TclpObjLstat(Tcl_Obj *pathPtr, Tcl_StatBuf *buf); MODULE_SCOPE Tcl_Obj * TclpTempFileName(void); MODULE_SCOPE Tcl_Obj * TclpTempFileNameForLibrary(Tcl_Interp *interp, Tcl_Obj* pathPtr); MODULE_SCOPE Tcl_Obj * TclNewFSPathObj(Tcl_Obj *dirPtr, const char *addStrRep, - int len, Tcl_Encoding encoding); + int len); MODULE_SCOPE int TclpDeleteFile(const void *path); MODULE_SCOPE void TclpFinalizeCondition(Tcl_Condition *condPtr); MODULE_SCOPE void TclpFinalizeMutex(Tcl_Mutex *mutexPtr); 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; } |