From 585b5b95cd2a7542cf4d49d89a50a72c654195f7 Mon Sep 17 00:00:00 2001 From: vasiljevic Date: Thu, 10 Jun 2004 17:10:18 +0000 Subject: Fixed Tcl_FSChdir not to forcefully update private cwd cached copy. This fixes the problem of [cwd] reporting relative file paths under certain cirumstances. --- ChangeLog | 11 +++++++++++ generic/tclIOUtil.c | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfc5bf7..5f0df68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-06-10 Zoran Vasiljevic + + * generic/tclIOUtil.c: removed forceful setting of the + private cached current working directory rep from + within the Tcl_FSChdir(). We delegate this task to + the Tcl_FSGetCwd() which does this task anyway. + The relevant code is still present but disabled + temporarily until the change proves correct. The Tcl + test suite passes all test with the given change so + I suppose it is good enough. + 2004-06-10 Don Porter * generic/tclPathObj.c: Corrected [file tail] results when operating diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 75f9849..094a2f5 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.104 2004/06/09 16:15:23 vasiljevic Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.105 2004/06/10 17:11:02 vasiljevic Exp $ */ #include "tclInt.h" @@ -2642,7 +2642,21 @@ Tcl_FSChdir(pathPtr) * calculated above, and we must therefore cache that * information. */ - if (retVal == 0) { + + /* + * The correct logic which performs the part below is + * already part of the Tcl_FSGetCwd() call, so no need + * to replicate it again. This will have a side effect + * though. The private authoritative representation of + * the current working directory stored in cwdPathPtr + * in static memory will be out-of-sync with the real + * OS-maintained value. The first call to Tcl_FSGetCwd + * will however recalculate the private copy to match + * the OS-value so everything will work right. + * We leave the below as a reminder until it's proven ok. + */ + + if (/* temporarily disabled */0 && retVal == 0) { /* * Note that this normalized path may be different to what * we found above (or at least a different object), if the -- cgit v0.12