From a797aaf84edab95144749877b07a3046ca669d6e Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 7 Jun 2011 21:06:06 +0000 Subject: Bug 2358545: Restore support for values "08" and "09"in a [spinbox] configured to use -from and -to values. --- ChangeLog | 5 +++++ generic/tkEntry.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46d0a23..2c9c1ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-06-07 Don Porter + + * generic/tkEntry.c: Restore support for values "08" and "09" + in a [spinbox] configured to use -from and -to values. [Bug 2358545]. + 2011-06-06 Don Porter * generic/tkConsole.c: Restore proper NUL output to the [console]. diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 3694375..f1c4816 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1330,11 +1330,10 @@ ConfigureEntry( * isn't a double value, we set it to -from. */ - int code; double dvalue; - code = Tcl_GetDouble(NULL, entryPtr->string, &dvalue); - if (code != TCL_OK) { + if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { + /* Scan failure */ dvalue = sbPtr->fromValue; } else { if (dvalue > sbPtr->toValue) { @@ -4241,9 +4240,9 @@ SpinboxInvoke( } else if (!DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)) { double dvalue; - if (Tcl_GetDouble(NULL, entryPtr->string, &dvalue) != TCL_OK) { + if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { /* - * If the string is empty, or isn't a valid double value, just + * If the string doesn't scan as a double value, just * use the -from value */ -- cgit v0.12