From 2fac71b8792d6ac9f91fd9c6c6f2d5b2a98dafc4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 23 Dec 2016 12:02:08 +0000 Subject: Little tweak: Decimal dot's should be allowed as well as first part. Test-case for that as well. --- generic/tclLink.c | 2 +- tests/link.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclLink.c b/generic/tclLink.c index a80ec8a..0b21997 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -701,7 +701,7 @@ SetInvalidRealFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) { return TCL_OK; } if (TclParseNumber(NULL, objPtr, NULL, str, length, &endPtr, - TCL_PARSE_DECIMAL_ONLY|TCL_PARSE_INTEGER_ONLY) == TCL_OK) { + TCL_PARSE_DECIMAL_ONLY) == TCL_OK) { /* If number is followed by [eE][+-]?, then it is an invalid * double, but it could be the start of a valid double. */ if (*endPtr == 'e' || *endPtr == 'E') { diff --git a/tests/link.test b/tests/link.test index 1e29ac5..7bde482 100644 --- a/tests/link.test +++ b/tests/link.test @@ -158,10 +158,10 @@ test link-2.8 {writing C variables from Tcl} -constraints {testlink} -setup { set uint 0 set long 0 set ulong 0 - set float -6000e+ + set float -60.00e+ set uwide 0 concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide -} -result {0 5000.0 0 0 0 0 0 0 0 0 0 0 -6000.0 0 | 0 5000e 0 0 0 0 0 0 0 0 0 0 -6000e+ 0} +} -result {0 5000.0 0 0 0 0 0 0 0 0 0 0 -60.0 0 | 0 5000e 0 0 0 0 0 0 0 0 0 0 -60.00e+ 0} test link-3.1 {read-only variables} {testlink} { testlink delete -- cgit v0.12