Tom Lane wrote:
> So forget my previous proposed patch and try this one:
>
> /* skip leading whitespace */
> while (*num != '\0' && isspace((unsigned char) *num))
> num++;
>
> errno = 0;
> val = strtod(num, &endptr);
>
> + if (endptr != num && endptr[-1] == 0)
> + endptr--;
>
> /* did we not see anything that looks like a double? */
Yeah, with this patch the tests just pass on solaris8.
--- float.c.orig Wed Aug 4 23:34:02 2004
+++ float.c Wed Aug 11 16:37:00 2004
@@ -282,6 +282,9 @@ errno = 0; val = strtod(num, &endptr);
+ if (endptr != num && endptr[-1] == 0)
+ endptr--;
+ /* did we not see anything that looks like a double? */ if (endptr == num || errno != 0) {
@@ -446,6 +449,10 @@
errno = 0; val = strtod(num, &endptr);
+
+ if (endptr != num && endptr[-1] == 0)
+ endptr--;
+
/* did we not see anything that looks like a double? */ if (endptr == num || errno != 0)
Regards, Martin Muenstermann