summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclNamesp.c8
-rw-r--r--generic/tclObj.c17
3 files changed, 15 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f7e705..c2bafd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* generic/tclExecute.c: comments added to explain iPtr->numLevels
management.
+ * generic/tclNamesp.c: tweaks to Tcl_GetCommandFromObj and
+ * generic/tclObj.c: TclGetNamespaceFromObj
+
2007-06-10 Miguel Sofer <msofer@users.sf.net>
* generic/tclBasic.c: Further TEOvI split, creating a new
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index df1f818..e717977 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.136 2007/06/10 20:25:56 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.137 2007/06/11 21:32:19 msofer Exp $
*/
#include "tclInt.h"
@@ -2839,9 +2839,7 @@ TclGetNamespaceFromObj(
name = TclGetString(objPtr);
isFQ = ((*name == ':') && (*(name+1) == ':'));
- refNsPtr = (Namespace *) (isFQ
- ? TclGetGlobalNamespace(interp)
- : TclGetCurrentNamespace(interp));
+ refNsPtr = (Namespace *) (isFQ? NULL :TclGetCurrentNamespace(interp));
/*
* Get the internal representation, converting to a namespace type if
@@ -2860,7 +2858,7 @@ TclGetNamespaceFromObj(
resPtr = (ResolvedNsName *) objPtr->internalRep.otherValuePtr;
if ((objPtr->typePtr != &tclNsNameType)
|| (resPtr == NULL)
- || (resPtr->refNsPtr != refNsPtr)
+ || (!isFQ && (resPtr->refNsPtr != refNsPtr))
|| (nsPtr = resPtr->nsPtr, nsPtr->flags & NS_DEAD)
|| (resPtr->nsId != nsPtr->nsId)) {
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 53dff2f..e250614 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclObj.c,v 1.125 2007/06/10 20:25:56 msofer Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.126 2007/06/11 21:32:19 msofer Exp $
*/
#include "tclInt.h"
@@ -3478,9 +3478,8 @@ Tcl_GetCommandFromObj(
name = TclGetString(objPtr);
isFQ = ((*name++ == ':') && (*name == ':'));
- refNsPtr = (Namespace *) (isFQ
- ? TclGetGlobalNamespace(interp)
- : TclGetCurrentNamespace(interp));
+ refNsPtr = (Namespace *) (isFQ? NULL :TclGetCurrentNamespace(interp));
+
/*
* Get the internal representation, converting to a command type if
@@ -3503,11 +3502,13 @@ Tcl_GetCommandFromObj(
resPtr = (ResolvedCmdName *) objPtr->internalRep.twoPtrValue.ptr1;
if ((objPtr->typePtr != &tclCmdNameType)
|| (resPtr == NULL)
- || (resPtr->refNsPtr != refNsPtr)
- || (resPtr->refNsId != refNsPtr->nsId)
- || (resPtr->refNsCmdEpoch != refNsPtr->cmdRefEpoch)
|| (cmdPtr = resPtr->cmdPtr, cmdPtr->cmdEpoch != resPtr->cmdEpoch)
- || (cmdPtr->flags & CMD_IS_DELETED)) {
+ || (cmdPtr->flags & CMD_IS_DELETED)
+ || ( !isFQ &&
+ ((resPtr->refNsPtr != refNsPtr)
+ || (resPtr->refNsId != refNsPtr->nsId)
+ || (resPtr->refNsCmdEpoch != refNsPtr->cmdRefEpoch)))
+ ) {
if (isFQ) {
refNsPtr = (Namespace *) TclGetCurrentNamespace(interp);