Index: generic/tclTrace.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTrace.c,v
retrieving revision 1.27
diff -u -r1.27 tclTrace.c
--- generic/tclTrace.c	29 Oct 2005 19:16:32 -0000	1.27
+++ generic/tclTrace.c	1 Nov 2005 19:42:10 -0000
@@ -1426,18 +1426,20 @@
 	    active.reverseScan = 0;
 	    active.nextTracePtr = tracePtr->nextPtr;
 	}
-	tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
-	if (tcmdPtr->flags != 0) {
-	    tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT;
-	    tcmdPtr->curCode  = code;
-	    tcmdPtr->refCount++;
-	    if (state == NULL) {
-		state = Tcl_SaveInterpState(interp, code);
-	    }
-	    traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp,
-		    curLevel, command, (Tcl_Command)cmdPtr, objc, objv);
-	    if ((--tcmdPtr->refCount) <= 0) {
-		ckfree((char*)tcmdPtr);
+	if (tracePtr->traceProc == TraceCommandProc) {
+	    tcmdPtr = (TraceCommandInfo*)tracePtr->clientData;
+	    if (tcmdPtr->flags != 0) {
+		tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT;
+		tcmdPtr->curCode  = code;
+		tcmdPtr->refCount++;
+		if (state == NULL) {
+		    state = Tcl_SaveInterpState(interp, code);
+		}
+		traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp,
+			curLevel, command, (Tcl_Command)cmdPtr, objc, objv);
+		if ((--tcmdPtr->refCount) <= 0) {
+		    ckfree((char*)tcmdPtr);
+		}
 	    }
 	}
 	if (active.nextTracePtr) {
