From 153e08d5cd7c0d6b7c7d8078214b575d04b4ae90 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 20 Feb 2009 18:19:31 +0000 Subject: * generic/tclPathObj.c: Fixed mistaken logic in TclFSGetPathType() * tests/fileName.test: that assumed (not "absolute" => "relative"). This is a false assumption on Windows, where "volumerelative" is another possibility. [Bug 2571597]. --- ChangeLog | 7 +++++++ generic/tclPathObj.c | 11 ++++++++++- tests/fileName.test | 8 +++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29ece9b..029392e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-20 Don Porter + + * generic/tclPathObj.c: Fixed mistaken logic in TclFSGetPathType() + * tests/fileName.test: that assumed (not "absolute" => "relative"). + This is a false assumption on Windows, where "volumerelative" is + another possibility. [Bug 2571597]. + 2009-02-17 Jeff Hobbs * win/tcl.m4, win/configure: Check if cl groks _WIN64 already to diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index dee1745..28345da 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.66.2.5 2008/12/04 17:45:02 dgp Exp $ + * RCS: @(#) $Id: tclPathObj.c,v 1.66.2.6 2009/02/20 18:19:32 dgp Exp $ */ #include "tclInt.h" @@ -510,7 +510,16 @@ TclFSGetPathType( } if (PATHFLAGS(pathPtr) == 0) { + /* The path is not absolute... */ +#ifdef __WIN32__ + /* ... on Windows we must make another call to determine whether + * it's relative or volumerelative [Bug 2571597]. */ + return TclGetPathType(pathPtr, filesystemPtrPtr, driveNameLengthPtr, + NULL); +#else + /* On other systems, quickly deduce !absolute -> relative */ return TCL_PATH_RELATIVE; +#endif } return TclFSGetPathType(fsPathPtr->cwdPtr, filesystemPtrPtr, driveNameLengthPtr); diff --git a/tests/fileName.test b/tests/fileName.test index ebad33b..2cd68c6 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -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: fileName.test,v 1.51.8.2 2008/08/14 13:08:45 dgp Exp $ +# RCS: @(#) $Id: fileName.test,v 1.51.8.3 2009/02/20 18:19:32 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1521,6 +1521,12 @@ test filename-17.2 {windows specific glob with executable} {win} { removeDirectory execglob set res } {abc.exe} +test filename-17.3 {Bug 2571597} win { + set p /a + file pathtype $p + file normalize $p + file pathtype $p +} volumerelative test fileName-18.1 {windows - split ADS name correctly} {win} { # bug 1194458 -- cgit v0.12