diff options
author | dgp <dgp@users.sourceforge.net> | 2004-08-25 22:21:17 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-08-25 22:21:17 (GMT) |
commit | 3060491426e52099c85b053985225c8518fa0d4e (patch) | |
tree | 2911c252cefc68e09a7d237a57016164078e6d32 /generic | |
parent | bbc1a01f8e4cbb285dfd5bf13c65230feef8fe05 (diff) | |
download | tcl-3060491426e52099c85b053985225c8518fa0d4e.zip tcl-3060491426e52099c85b053985225c8518fa0d4e.tar.gz tcl-3060491426e52099c85b053985225c8518fa0d4e.tar.bz2 |
* tests/timer.test (timer-10.1): Test for Bug 1016167.
* generic/tclTimer.c: Workaround for situation when a
[namespace import] causes the objv[0] value to be something
other than what Tcl_AfterObjCmd expects. [Bug 1016167].
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclTimer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclTimer.c b/generic/tclTimer.c index b441ac3..f7a3d46 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTimer.c,v 1.8 2004/04/06 22:25:55 dgp Exp $ + * RCS: @(#) $Id: tclTimer.c,v 1.9 2004/08/25 22:21:34 dgp Exp $ */ #include "tclInt.h" @@ -765,6 +765,12 @@ Tcl_AfterObjCmd(clientData, interp, objc, objv) */ if (assocPtr == NULL) { + Tcl_Command token = Tcl_GetCommandFromObj(interp, objv[0]); + Tcl_Command originalToken = TclGetOriginalCommand(token); + + if (originalToken != NULL) { + token = originalToken; + } assocPtr = (AfterAssocData *) ckalloc(sizeof(AfterAssocData)); assocPtr->interp = interp; assocPtr->firstAfterPtr = NULL; @@ -776,8 +782,8 @@ Tcl_AfterObjCmd(clientData, interp, objc, objv) cmdInfo.objClientData = (ClientData) assocPtr; cmdInfo.deleteProc = NULL; cmdInfo.deleteData = (ClientData) assocPtr; - Tcl_SetCommandInfo(interp, Tcl_GetStringFromObj(objv[0], &length), - &cmdInfo); + + Tcl_SetCommandInfoFromToken(token, &cmdInfo); } /* |