summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-08-11 15:16:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-08-11 15:16:21 (GMT)
commitbe60925512e642d383cdd2af3ba6e46493ddd54e (patch)
treeb0cd1290e9fe19d67f2d4ef24f1f7120fae4ca31
parent4268e703ba2d9209504409cbf6629a1a80e7054f (diff)
downloadtcl-be60925512e642d383cdd2af3ba6e46493ddd54e.zip
tcl-be60925512e642d383cdd2af3ba6e46493ddd54e.tar.gz
tcl-be60925512e642d383cdd2af3ba6e46493ddd54e.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.