diff options
author | pooryorick <com.digitalsmarties@pooryorick.com> | 2017-11-17 22:30:06 (GMT) |
---|---|---|
committer | pooryorick <com.digitalsmarties@pooryorick.com> | 2017-11-17 22:30:06 (GMT) |
commit | 3c942c50d91bc8ea58c64065922babf397943e8f (patch) | |
tree | b2bbd710aecb79f626a50dea36f5254cc2c2ab67 /generic/tclNamesp.c | |
parent | 48047bb120a19ed52c13f484cc0685fe7218ae50 (diff) | |
download | tcl-3c942c50d91bc8ea58c64065922babf397943e8f.zip tcl-3c942c50d91bc8ea58c64065922babf397943e8f.tar.gz tcl-3c942c50d91bc8ea58c64065922babf397943e8f.tar.bz2 |
Fix [16fe1b5807]: namespace ensemble command named ":" is mistakenly given the
empty string as its name.
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r-- | generic/tclNamesp.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index e1bad0e..e7914ad 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -2424,6 +2424,35 @@ TclGetNamespaceForQualName( /* *---------------------------------------------------------------------- * + * TclEnsureNamespace -- + * + * Provide a namespace that is not deleted. + * + * Value + * + * namespacePtr, if it is not scheduled for deletion, or a pointer to a + * new namespace with the same name otherwise. + * + * Effect + * None. + * + *---------------------------------------------------------------------- + */ +Tcl_Namespace * +TclEnsureNamespace( + Tcl_Interp *interp, + Tcl_Namespace *namespacePtr) +{ + Namespace *nsPtr = (Namespace *) namespacePtr; + if (!nsPtr->flags & NS_DYING) { + return namespacePtr; + } + return Tcl_CreateNamespace(interp, nsPtr->fullName, NULL, NULL); +} + +/* + *---------------------------------------------------------------------- + * * Tcl_FindNamespace -- * * Searches for a namespace. @@ -2638,7 +2667,7 @@ Tcl_FindCommand( Namespace *nsPtr[2]; register int search; - TclGetNamespaceForQualName(interp, name, (Namespace *) contextNsPtr, + TclGetNamespaceForQualName(interp, name, cxtNsPtr, flags, &nsPtr[0], &nsPtr[1], &cxtNsPtr, &simpleName); /* |