diff options
author | vincentdarley <vincentdarley> | 2005-08-08 23:20:08 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2005-08-08 23:20:08 (GMT) |
commit | 1867a443a7465499ed1ac544e3d9d8a2b547843b (patch) | |
tree | 921bcbc13c1de260e6b9e5505fd99c27b07dd761 | |
parent | 7cd7d43d4c30ccf407db8a9d565624b86bd9cfe0 (diff) | |
download | tcl-1867a443a7465499ed1ac544e3d9d8a2b547843b.zip tcl-1867a443a7465499ed1ac544e3d9d8a2b547843b.tar.gz tcl-1867a443a7465499ed1ac544e3d9d8a2b547843b.tar.bz2 |
file rootname bug fix
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclPathObj.c | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -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; } } |