diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-12-06 12:27:50 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-12-06 12:27:50 (GMT) |
| commit | fe4ff7a3fb60d7dd8c75e1b33dae1fc70f15fdc0 (patch) | |
| tree | 4425148c353ff24118c096bbba98806625bf463e /generic/tclNamesp.c | |
| parent | d2ef001c4971191280470eca5f1cf9dc1e2d8070 (diff) | |
| parent | 72f0f0b3468809e3a3a26e448b3bd3be8a8398a6 (diff) | |
| download | tcl-fe4ff7a3fb60d7dd8c75e1b33dae1fc70f15fdc0.zip tcl-fe4ff7a3fb60d7dd8c75e1b33dae1fc70f15fdc0.tar.gz tcl-fe4ff7a3fb60d7dd8c75e1b33dae1fc70f15fdc0.tar.bz2 | |
merge core-8-branch
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..d661856 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); /* |
