summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 629293f..50f80d4 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.75.2.5 2003/07/18 23:35:38 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.75.2.6 2003/09/29 22:03:44 dgp Exp $
*/
#include "tclInt.h"
@@ -2560,6 +2560,9 @@ CallCommandTraces(iPtr, cmdPtr, oldName, newName, flags)
ActiveCommandTrace active;
char *result;
Tcl_Obj *oldNamePtr = NULL;
+ int mask = (TCL_TRACE_DELETE | TCL_TRACE_RENAME); /* Safety */
+
+ flags &= mask;
if (cmdPtr->flags & CMD_TRACE_ACTIVE) {
/*
@@ -2595,11 +2598,13 @@ CallCommandTraces(iPtr, cmdPtr, oldName, newName, flags)
for (tracePtr = cmdPtr->tracePtr; tracePtr != NULL;
tracePtr = active.nextTracePtr) {
+ int traceFlags = (tracePtr->flags & mask);
+
active.nextTracePtr = tracePtr->nextPtr;
- if (!(tracePtr->flags & flags)) {
+ if (!(traceFlags & flags)) {
continue;
}
- cmdPtr->flags |= tracePtr->flags;
+ cmdPtr->flags |= traceFlags;
if (oldName == NULL) {
TclNewObj(oldNamePtr);
Tcl_IncrRefCount(oldNamePtr);
@@ -2610,7 +2615,7 @@ CallCommandTraces(iPtr, cmdPtr, oldName, newName, flags)
tracePtr->refCount++;
(*tracePtr->traceProc)(tracePtr->clientData,
(Tcl_Interp *) iPtr, oldName, newName, flags);
- cmdPtr->flags &= ~tracePtr->flags;
+ cmdPtr->flags &= ~traceFlags;
if ((--tracePtr->refCount) <= 0) {
ckfree((char*)tracePtr);
}