summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclPathObj.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 410a4c9..d0a430d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-09 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tclPathObj.c: fix to [file rootname] bug in optimized
+ code path reported on comp.lang.tcl.
+
2005-08-06 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* generic/tclThreadStorage.c: Stop exposing the guts of the thread
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 362d489..96190d0 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.42 2005/07/21 14:38:50 dkf Exp $
+ * RCS: @(#) $Id: tclPathObj.c,v 1.43 2005/08/08 23:20:11 vincentdarley Exp $
*/
#include "tclInt.h"
@@ -572,7 +572,6 @@ TclPathPart(interp, pathPtr, portion)
case TCL_PATH_EXTENSION:
return GetExtension(fsPathPtr->normPathPtr);
case TCL_PATH_ROOT: {
- /* Unimplemented */
CONST char *fileName, *extension;
int length;
@@ -607,6 +606,10 @@ TclPathPart(interp, pathPtr, portion)
Tcl_SetObjLength(fsDupPtr->normPathPtr,
(int)(length - strlen(extension)));
}
+ if (root->bytes != NULL && root->length > 0) {
+ /* Have string rep as well */
+ root->length -= strlen(extension);
+ }
return root;
}
}