From de7a13a1ea31d6c10dabac82980991548cfac45a Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Wed, 9 Nov 2005 21:46:19 +0000 Subject: Bug 1350293 --- ChangeLog | 5 +++++ generic/tclTimer.c | 5 +++-- tests/timer.test | 24 +++++++++++------------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 210ce5a..5c7b243 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-09 Kevin B. Kenny + + * generic/tclTimer.c: Changed [after] so that it behaves correctly + * tests/timer.test: with negative arguments [Bug 1350293]. + 2005-11-08 Jeff Hobbs * unix/tclUnixFCmd.c (MAX_READDIR_UNLINK_THRESHOLD): reduce to 130 diff --git a/generic/tclTimer.c b/generic/tclTimer.c index 5832382..ef9bf24 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.6.2.3 2005/10/04 18:14:14 vasiljevic Exp $ + * RCS: @(#) $Id: tclTimer.c,v 1.6.2.4 2005/11/09 21:46:20 kennykb Exp $ */ #include "tclInt.h" @@ -781,7 +781,8 @@ Tcl_AfterObjCmd(clientData, interp, objc, objv) goto processInteger; } argString = Tcl_GetStringFromObj(objv[1], &length); - if (isdigit(UCHAR(argString[0]))) { /* INTL: digit */ + if (argString[0] == '+' || argString[0] == '-' + || isdigit(UCHAR(argString[0]))) { /* INTL: digit */ if (Tcl_GetIntFromObj(interp, objv[1], &ms) != TCL_OK) { return TCL_ERROR; } diff --git a/tests/timer.test b/tests/timer.test index cd76ef0..cf0e312 100644 --- a/tests/timer.test +++ b/tests/timer.test @@ -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: timer.test,v 1.7.22.1 2004/10/26 20:14:51 dgp Exp $ +# RCS: @(#) $Id: timer.test,v 1.7.22.2 2005/11/09 21:46:20 kennykb Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -549,18 +549,16 @@ test timer-10.1 {Bug 1016167: [after] overwrites imports} -setup { interp delete slave } -result ::after +test timer-11.2 {Bug 1350293: [after] negative argument} \ + -body { + set l {} + after 100 {lappend l 100; set done 1} + after -1 {lappend l -1} + vwait done + set l + } \ + -result {-1 100} + # cleanup ::tcltest::cleanupTests return - - - - - - - - - - - - -- cgit v0.12