summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2006-08-11 15:16:21 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2006-08-11 15:16:21 (GMT)
commite5a0e9624fbb033cce6d85e7a9ecabae33abcfa3 (patch)
treeb0cd1290e9fe19d67f2d4ef24f1f7120fae4ca31
parent9a1e8d0591bd808849ce5614514ae2c89cbe1506 (diff)
downloadtcl-e5a0e9624fbb033cce6d85e7a9ecabae33abcfa3.zip
tcl-e5a0e9624fbb033cce6d85e7a9ecabae33abcfa3.tar.gz
tcl-e5a0e9624fbb033cce6d85e7a9ecabae33abcfa3.tar.bz2
It seems that the original submitter of the patch didn't test it. Add a
critical buffer reset so that nested namespaces get the right fullName...
-rw-r--r--generic/tclNamesp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 66b857e..15ed318 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -22,7 +22,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.96 2006/08/11 13:50:23 dkf Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.97 2006/08/11 15:16:21 dkf Exp $
*/
#include "tclInt.h"
@@ -860,6 +860,14 @@ Tcl_CreateNamespace(
Tcl_DStringLength(namePtr));
/*
+ * Clear the unwanted buffer or we end up appending to previous
+ * results, making the namespace fullNames of nested namespaces
+ * very wrong (and strange).
+ */
+
+ Tcl_DStringSetLength(namePtr, 0);
+
+ /*
* Now swap the buffer pointers so that we build in the other
* buffer. This is faster than repeated copying back and forth
* between buffers.