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)
commit2e99120257a8ebe71af4bcfeab8cc1d031a4bd24 (patch)
tree0a9a1877392958e625398eecb6274336605a99a9 /generic/tclBasic.c
parenta0b5a0ccd26e0fa70be2e05583c04493b7ecb627 (diff)
downloadtcl-2e99120257a8ebe71af4bcfeab8cc1d031a4bd24.zip
tcl-2e99120257a8ebe71af4bcfeab8cc1d031a4bd24.tar.gz
tcl-2e99120257a8ebe71af4bcfeab8cc1d031a4bd24.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;
+ }
}
}