diff options
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r-- | generic/tclNamesp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 27f5603..61329d3 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.74 2005/05/10 18:34:45 kennykb Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.75 2005/05/19 22:49:01 dkf Exp $ */ #include "tclInt.h" @@ -1699,10 +1699,11 @@ Tcl_ForgetImport(interp, namespacePtr, pattern) if (TclMatchIsTrivial(simplePattern)) { Command *cmdPtr; hPtr = Tcl_FindHashEntry(&nsPtr->cmdTable, simplePattern); - (hPtr != NULL) + if ((hPtr != NULL) && (cmdPtr = (Command *) Tcl_GetHashValue(hPtr)) - && (cmdPtr->deleteProc == DeleteImportedCmd) - && Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr); + && (cmdPtr->deleteProc == DeleteImportedCmd)) { + Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr); + } return TCL_OK; } for (hPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search); |