summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 0c9ff94..1ab108f 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.19 2005/05/25 19:25:57 hobbs Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.20 2005/06/21 17:19:42 dgp Exp $
*/
#include "tclInt.h"
@@ -3972,7 +3972,11 @@ Tcl_UntraceCommand(interp, cmdName, flags, proc, clientData)
for (activePtr = iPtr->activeCmdTracePtr; activePtr != NULL;
activePtr = activePtr->nextPtr) {
if (activePtr->nextTracePtr == tracePtr) {
- activePtr->nextTracePtr = tracePtr->nextPtr;
+ if (activePtr->reverseScan) {
+ activePtr->nextTracePtr = prevPtr;
+ } else {
+ activePtr->nextTracePtr = tracePtr->nextPtr;
+ }
}
}
if (prevPtr == NULL) {
@@ -4201,6 +4205,7 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code,
tracePtr = active.nextTracePtr) {
if (traceFlags & TCL_TRACE_LEAVE_EXEC) {
/* execute the trace command in order of creation for "leave" */
+ active.reverseScan = 1;
active.nextTracePtr = NULL;
tracePtr = cmdPtr->tracePtr;
while (tracePtr->nextPtr != lastTracePtr) {
@@ -4208,6 +4213,7 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code,
tracePtr = tracePtr->nextPtr;
}
} else {
+ active.reverseScan = 0;
active.nextTracePtr = tracePtr->nextPtr;
}
tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
@@ -4225,7 +4231,9 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code,
ckfree((char*)tcmdPtr);
}
}
- lastTracePtr = tracePtr;
+ if (active.nextTracePtr) {
+ lastTracePtr = active.nextTracePtr->nextPtr;
+ }
}
iPtr->activeCmdTracePtr = active.nextPtr;
return(traceCode);
@@ -4296,6 +4304,7 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
* Tcl_CreateObjTrace creates one more linked list of traces
* which results in one more reversal of trace invocation.
*/
+ active.reverseScan = 1;
active.nextTracePtr = NULL;
tracePtr = iPtr->tracePtr;
while (tracePtr->nextPtr != lastTracePtr) {
@@ -4303,6 +4312,7 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
tracePtr = tracePtr->nextPtr;
}
} else {
+ active.reverseScan = 0;
active.nextTracePtr = tracePtr->nextPtr;
}
if (tracePtr->level > 0 && curLevel > tracePtr->level) {
@@ -4347,7 +4357,9 @@ TclCheckInterpTraces(interp, command, numChars, cmdPtr, code,
tracePtr->flags &= ~TCL_TRACE_EXEC_IN_PROGRESS;
Tcl_Release((ClientData) tracePtr);
}
- lastTracePtr = tracePtr;
+ if (active.nextTracePtr) {
+ lastTracePtr = active.nextTracePtr->nextPtr;
+ }
}
iPtr->activeInterpTracePtr = active.nextPtr;
return(traceCode);