summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-09-10 18:15:24 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-09-10 18:15:24 (GMT)
commit0f9b7b55baae648f729e6f24fec0887d1f38138a (patch)
treee0c5de7e2d8f02f6e177178525fab8cd6cebe1a9 /generic
parent02ca88a79487e618d0aa1bf9a949ecb18cbd0acc (diff)
downloadtcl-0f9b7b55baae648f729e6f24fec0887d1f38138a.zip
tcl-0f9b7b55baae648f729e6f24fec0887d1f38138a.tar.gz
tcl-0f9b7b55baae648f729e6f24fec0887d1f38138a.tar.bz2
* generic/tclNamespace.c (TclGetNamespaceForQualName): Resolved
longstanding inconsistency in the treatment of the TCL_NAMESPACE_ONLY flag revealed by testing the 2004-09-09 commits against Itcl. TCL_NAMESPACE_ONLY now acts as specified in the pre-function comment, forcing resolution in the passed in context namespace. It has been incorrectly forcing resolution in the interp's current namespace.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclNamesp.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 9a60232..a524f12 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -21,7 +21,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.50 2004/09/09 17:09:34 dgp Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.51 2004/09/10 18:15:25 dgp Exp $
*/
#include "tclInt.h"
@@ -1814,8 +1814,7 @@ TclGetNamespaceForQualName(interp, qualName, cxtNsPtr, flags,
Namespace *cxtNsPtr; /* The namespace in which to start the
* search for qualName's namespace. If NULL
* start from the current namespace.
- * Ignored if TCL_GLOBAL_ONLY or
- * TCL_NAMESPACE_ONLY are set. */
+ * Ignored if TCL_GLOBAL_ONLY is set. */
int flags; /* Flags controlling the search: an OR'd
* combination of TCL_GLOBAL_ONLY,
* TCL_NAMESPACE_ONLY,
@@ -1858,17 +1857,14 @@ TclGetNamespaceForQualName(interp, qualName, cxtNsPtr, flags,
/*
* Determine the context namespace nsPtr in which to start the primary
- * search. If TCL_NAMESPACE_ONLY or TCL_FIND_ONLY_NS was specified, search
- * from the current namespace. If the qualName name starts with a "::"
- * or TCL_GLOBAL_ONLY was specified, search from the global
- * namespace. Otherwise, use the given namespace given in cxtNsPtr, or
- * if that is NULL, use the current namespace context. Note that we
- * always treat two or more adjacent ":"s as a namespace separator.
+ * search. If the qualName name starts with a "::" or TCL_GLOBAL_ONLY
+ * was specified, search from the global namespace. Otherwise, use the
+ * given namespace given in cxtNsPtr, or if that is NULL, use the current
+ * namespace context. Note that we always treat two or more
+ * adjacent ":"s as a namespace separator.
*/
- if (flags & (TCL_NAMESPACE_ONLY | TCL_FIND_ONLY_NS)) {
- nsPtr = (Namespace *) Tcl_GetCurrentNamespace(interp);
- } else if (flags & TCL_GLOBAL_ONLY) {
+ if (flags & TCL_GLOBAL_ONLY) {
nsPtr = globalNsPtr;
} else if (nsPtr == NULL) {
if (iPtr->varFramePtr != NULL) {