summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2011-06-07 21:14:22 (GMT)
committerdgp <dgp@noemail.net>2011-06-07 21:14:22 (GMT)
commit644e3484848a87b4894c2bba52ebfd6bcfb5148c (patch)
treee18d63c5d5ea65e27686b5d6f741e01078d03a5a
parentad78a4162214f8669db54f7e2b5b7109295f58fe (diff)
parent578a822f555453c7bfc7085d6eae1810495f17d5 (diff)
downloadtk-644e3484848a87b4894c2bba52ebfd6bcfb5148c.zip
tk-644e3484848a87b4894c2bba52ebfd6bcfb5148c.tar.gz
tk-644e3484848a87b4894c2bba52ebfd6bcfb5148c.tar.bz2
Bug 2358545: Restore support for values "08" and "09"in a spinbox configured
to use -from and -to values. FossilOrigin-Name: 054999f452c30d6b796509c33e0eac3e588148a8
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkEntry.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f4a8cc8..1d5746a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-07 Don Porter <dgp@users.sourceforge.net>
+
+ * 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 <dgp@users.sourceforge.net>
* generic/tkConsole.c: Restore proper NUL output to the [console].
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 1db3888..a69fbd6 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1327,11 +1327,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) {
dvalue = sbPtr->toValue;
@@ -4227,9 +4226,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
*/