summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-02-10 12:50:30 (GMT)
committervincentdarley <vincentdarley>2003-02-10 12:50:30 (GMT)
commit71073845ccadf428914c16d0163073f941114c72 (patch)
treec3b570affd9947fcdb255e3417752cd71200acc1 /generic/tclIOUtil.c
parent850d398c1a0776e72d591c406090dfaca8492aeb (diff)
downloadtcl-71073845ccadf428914c16d0163073f941114c72.zip
tcl-71073845ccadf428914c16d0163073f941114c72.tar.gz
tcl-71073845ccadf428914c16d0163073f941114c72.tar.bz2
further fs cleanup
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c51
1 files changed, 8 insertions, 43 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 6c7b9c0..f48876d 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.72 2003/02/10 10:26:25 vincentdarley Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.73 2003/02/10 12:50:31 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -3954,10 +3954,9 @@ UpdateStringOfFsPath(objPtr)
break;
case TCL_PLATFORM_WINDOWS:
/*
- * We need the cwdLen > 2 because a volume
- * relative path doesn't get a '/'. For
- * example 'glob C:*cat*.exe' will return
- * 'C:cat32.exe'
+ * We need the extra 'cwdLen != 2', and ':' checks because
+ * a volume relative path doesn't get a '/'. For example
+ * 'glob C:*cat*.exe' will return 'C:cat32.exe'
*/
if (cwdStr[cwdLen-1] != '/'
&& cwdStr[cwdLen-1] != '\\') {
@@ -4547,6 +4546,9 @@ Tcl_FSGetTranslatedPath(interp, pathPtr)
}
srcFsPathPtr = (FsPath*) pathPtr->internalRep.otherValuePtr;
if (srcFsPathPtr->translatedPathPtr == NULL) {
+ if (srcFsPathPtr->flags != 0) {
+ return Tcl_FSGetNormalizedPath(interp, pathPtr);
+ }
/*
* It is a pure absolute, normalized path object.
* This is something like being a 'pure list'. The
@@ -4956,43 +4958,6 @@ Tcl_FSGetNativePath(pathObjPtr)
return (CONST char *)Tcl_FSGetInternalRep(pathObjPtr, &tclNativeFilesystem);
}
-static Tcl_Obj*
-FsGetValidObjRep(interp, objPtr)
- Tcl_Interp *interp; /* Interpreter in which to store error
- * message (if necessary). */
- Tcl_Obj *objPtr; /* Object to convert to a valid, current
- * path type. */
-{
- FsPath *fsPathPtr;
- if (objPtr->typePtr != &tclFsPathType) {
- if (Tcl_ConvertToType(interp, objPtr, &tclFsPathType) != TCL_OK) {
- return NULL;
- }
- }
- fsPathPtr = (FsPath*) objPtr->internalRep.otherValuePtr;
-
- if (fsPathPtr->filesystemEpoch != theFilesystemEpoch) {
- if (objPtr->bytes == NULL) {
- UpdateStringOfFsPath(objPtr);
- }
- FreeFsPathInternalRep(objPtr);
- objPtr->typePtr = NULL;
- if (Tcl_ConvertToType(interp, objPtr, &tclFsPathType) != TCL_OK) {
- return NULL;
- }
- fsPathPtr = (FsPath*) objPtr->internalRep.otherValuePtr;
- }
-
- if (fsPathPtr->cwdPtr != NULL) {
- if (FsCwdPointerEquals(fsPathPtr->cwdPtr)) {
- /* This causes a few minor test failures with links */
- /* Once these are resolved, this would improve efficiency */
- /* return objPtr; */
- }
- }
- return Tcl_FSGetNormalizedPath(interp, objPtr);
-}
-
/*
*---------------------------------------------------------------------------
*
@@ -5019,7 +4984,7 @@ NativeCreateNativeRep(pathObjPtr)
char *str;
/* Make sure the normalized path is set */
- validPathObjPtr = FsGetValidObjRep(NULL, pathObjPtr);
+ validPathObjPtr = Tcl_FSGetNormalizedPath(NULL, pathObjPtr);
str = Tcl_GetStringFromObj(validPathObjPtr, &len);
#ifdef __WIN32__