From 546d6ca6ea71958e884437bf65cb7b2421590747 Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Tue, 18 Mar 2003 10:51:28 +0000 Subject: Fixes for three filesystem problems --- ChangeLog | 10 ++++++++++ generic/tclIOUtil.c | 4 +++- tests/cmdAH.test | 6 +++--- win/tclWinFile.c | 12 +++++++++++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6567aab..859aed1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-03-18 Vince Darley + + * tests/cmdAH.test: fix test suite problem if /home is a symlink + * generic/tclIOUtil.c: fix bad error message with 'cd ""' + * win/tclWinFile.c: allow Tcl to differentiate between reparse + points which are symlinks and mounted drives. + + These changes fix [Bug #703264], [Bug #704917], [Bug #697862] + respectively. + 2003-03-17 Donal K. Fellows * doc/lsearch.n: Altered documentation of -ascii options so diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 29ba700..924689a 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.77 2003/03/03 20:22:41 das Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.1 2003/03/18 10:51:31 vincentdarley Exp $ */ #include "tclInt.h" @@ -2528,6 +2528,8 @@ Tcl_FSChdir(pathPtr) cwdPathPtr = normDirName; Tcl_MutexUnlock(&cwdMutex); } + } else { + Tcl_SetErrno(ENOENT); } return (retVal); diff --git a/tests/cmdAH.test b/tests/cmdAH.test index fe16def..9b26f8e 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.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: cmdAH.test,v 1.30 2003/01/09 10:38:32 vincentdarley Exp $ +# RCS: @(#) $Id: cmdAH.test,v 1.30.2.1 2003/03/18 10:51:31 vincentdarley Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 @@ -401,7 +401,7 @@ test cmdAH-8.43 {Tcl_FileObjCmd: dirname} { set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp set result -} {0 /home} +} [list 0 [expr {([file exists /home] && ([file type /home] == "link")) ? [file readlink /home] : "/home"}]] test cmdAH-8.44 {Tcl_FileObjCmd: dirname} { global env set temp $env(HOME) @@ -419,7 +419,7 @@ test cmdAH-8.45 {Tcl_FileObjCmd: dirname} { set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp set result -} {0 /home} +} [list 0 [expr {([file exists /home] && ([file type /home] == "link")) ? [file readlink /home] : "/home"}]] test cmdAH-8.46 {Tcl_FileObjCmd: dirname} { global env set temp $env(HOME) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 8213e6d..f44140f 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.44 2003/02/10 12:50:32 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.1 2003/03/18 10:51:31 vincentdarley Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -474,6 +474,16 @@ WinReadLinkDirectory(LinkDirectory) if (0 == strncmp(copy,"\\??\\",4)) { copy += 4; len -= 4; + if (0 == strncmp(copy,"Volume{",7)) { + /* + * This is actually a mounted drive, which is in any + * case treated as being mounted in place, so it is + * in some sense a symlink to itself + */ + Tcl_DStringFree(&ds); + Tcl_SetErrno(EINVAL); + return NULL; + } } else if (0 == strncmp(copy,"\\\\?\\",4)) { copy += 4; len -= 4; -- cgit v0.12