From be5eee52adacf1bd8b62748f672f5026b9ce127b Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Thu, 18 Sep 2003 11:29:26 +0000 Subject: fileName test suite bug fix --- ChangeLog | 6 ++++++ generic/tclPathObj.c | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7b1ca5..c864a72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-09-17 Vince Darley + + * tclPathObj.c: fix to test-suite problem introduced by the bug + fix below. No problem in ordinary code, just test suite code + which manually adjusts tclPlatform. [Bug 808247] + 2003-09-16 Vince Darley * doc/filename.n: documentation of Windows-specific feature as 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 */ -- cgit v0.12