summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-06-21 17:19:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-06-21 17:19:36 (GMT)
commit5327d7f6b40ae57f46596ba4eb8532933caf1c8d (patch)
tree0a9a1877392958e625398eecb6274336605a99a9 /generic/tclBasic.c
parent595cf2aba7948ee9675228361986c54e7fed8409 (diff)
downloadtcl-5327d7f6b40ae57f46596ba4eb8532933caf1c8d.zip
tcl-5327d7f6b40ae57f46596ba4eb8532933caf1c8d.tar.gz
tcl-5327d7f6b40ae57f46596ba4eb8532933caf1c8d.tar.bz2
* generic/tclBasic.c: Made the walk of the active trace list aware
* generic/tclCmdMZ.c: of the direction of trace scanning, so the * generic/tclInt.h: proper correction can be made. [Bug 1224585] * tests/trace.test (trace-34.2,3):
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index ccb6de9..f1423cf 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.15 2005/06/21 14:44:58 dgp Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.75.2.16 2005/06/21 17:19:40 dgp Exp $
*/
#include "tclInt.h"
@@ -2585,6 +2585,7 @@ CallCommandTraces(iPtr, cmdPtr, oldName, newName, flags)
result = NULL;
active.nextPtr = iPtr->activeCmdTracePtr;
+ active.reverseScan = 0;
iPtr->activeCmdTracePtr = &active;
if (flags & TCL_TRACE_DELETE) {
@@ -5158,7 +5159,7 @@ Tcl_DeleteTrace(interp, trace)
* Tcl_CreateTrace). */
{
Interp *iPtr = (Interp *) interp;
- Trace *tracePtr = (Trace *) trace;
+ Trace *prevPtr, *tracePtr = (Trace *) trace;
register Trace **tracePtr2 = &(iPtr->tracePtr);
ActiveInterpTrace *activePtr;
@@ -5167,7 +5168,9 @@ Tcl_DeleteTrace(interp, trace)
* and remove it from the list.
*/
+ prevPtr = NULL;
while ((*tracePtr2) != NULL && (*tracePtr2) != tracePtr) {
+ prevPtr = *tracePtr2;
tracePtr2 = &((*tracePtr2)->nextPtr);
}
if (*tracePtr2 == NULL) {
@@ -5184,7 +5187,11 @@ Tcl_DeleteTrace(interp, trace)
for (activePtr = iPtr->activeInterpTracePtr; activePtr != NULL;
activePtr = activePtr->nextPtr) {
if (activePtr->nextTracePtr == tracePtr) {
- activePtr->nextTracePtr = tracePtr->nextPtr;
+ if (activePtr->reverseScan) {
+ activePtr->nextTracePtr = prevPtr;
+ } else {
+ activePtr->nextTracePtr = tracePtr->nextPtr;
+ }
}
}