summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-09-18 11:29:26 (GMT)
committervincentdarley <vincentdarley>2003-09-18 11:29:26 (GMT)
commitbe5eee52adacf1bd8b62748f672f5026b9ce127b (patch)
treeb63a4b720140c83d88050bc257f8a91bd8725fb2 /generic/tclPathObj.c
parentb955a84cbccac90a2e86c31ece45610838e409f3 (diff)
downloadtcl-be5eee52adacf1bd8b62748f672f5026b9ce127b.zip
tcl-be5eee52adacf1bd8b62748f672f5026b9ce127b.tar.gz
tcl-be5eee52adacf1bd8b62748f672f5026b9ce127b.tar.bz2
fileName test suite bug fix
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index e7718b1..3477b60 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPathObj.c,v 1.7 2003/09/16 14:56:08 vincentdarley Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.8 2003/09/18 11:29:27 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -1177,7 +1177,6 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
*/
Tcl_Obj *absolutePath = fsPathPtr->translatedPathPtr;
char *path = Tcl_GetString(absolutePath);
- int type;
/*
* We have to be a little bit careful here to avoid infinite loops
@@ -1186,7 +1185,7 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
* action, which might loop back through here.
*/
if (path[0] != '\0') {
- type = Tcl_FSGetPathType(pathObjPtr);
+ Tcl_PathType type = Tcl_FSGetPathType(pathObjPtr);
if (type == TCL_PATH_RELATIVE) {
useThisCwd = Tcl_FSGetCwd(interp);
@@ -1195,6 +1194,7 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
absolutePath = Tcl_FSJoinToPath(useThisCwd, 1, &absolutePath);
Tcl_IncrRefCount(absolutePath);
/* We have a refCount on the cwd */
+#ifdef __WIN32__
} else if (type == TCL_PATH_VOLUME_RELATIVE) {
/*
* Only Windows has volume-relative paths. These
@@ -1203,6 +1203,12 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
* handle them here, rather than in the native fs code,
* because we really need to have a real absolute path
* just below.
+ *
+ * We do not let this block compile on non-Windows
+ * platforms because the test suite's manual forcing
+ * of tclPlatform can otherwise cause this code path
+ * to be executed, causing various errors because
+ * volume-relative paths really do not exist.
*/
useThisCwd = Tcl_FSGetCwd(interp);
if (useThisCwd == NULL) return NULL;
@@ -1239,6 +1245,7 @@ Tcl_FSGetNormalizedPath(interp, pathObjPtr)
useThisCwd = NULL;
}
}
+#endif /* __WIN32__ */
}
}
/* Already has refCount incremented */