summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-02-06 21:08:05 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-02-06 21:08:05 (GMT)
commit11d70a65e6f7578f2d0e486b978142e3bcdcc304 (patch)
tree7ad5524122d1e3696248043277e03193466d2d73 /generic
parent88cd3810ef18b4e05cae8aebda92c41155ce7f1a (diff)
downloadtcl-11d70a65e6f7578f2d0e486b978142e3bcdcc304.zip
tcl-11d70a65e6f7578f2d0e486b978142e3bcdcc304.tar.gz
tcl-11d70a65e6f7578f2d0e486b978142e3bcdcc304.tar.bz2
* generic/tclNamesp.c: Corrected broken implementation of the
* tests/namespace.test: TclMatchIsTrivial optimization on [namespace children $namespace $pattern].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclNamesp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index d641eef..f5f3da1 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.121 2006/12/08 13:50:42 dkf Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.122 2007/02/06 21:08:06 dgp Exp $
*/
#include "tclInt.h"
@@ -3113,7 +3113,11 @@ NamespaceChildrenCmd(
listPtr = Tcl_NewListObj(0, NULL);
if ((pattern != NULL) && TclMatchIsTrivial(pattern)) {
- if (Tcl_FindHashEntry(&nsPtr->childTable, pattern) != NULL) {
+ int length = strlen(nsPtr->fullName);
+ if (strncmp(pattern, nsPtr->fullName, length) != 0) {
+ goto searchDone;
+ }
+ if (Tcl_FindHashEntry(&nsPtr->childTable, pattern+length) != NULL) {
Tcl_ListObjAppendElement(interp, listPtr,
Tcl_NewStringObj(pattern, -1));
}