|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.106 2004/08/04 21:34:02 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.107 2004/08/11 17:20:49 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -317,6 +317,18 @@ float4in(PG_FUNCTION_ARGS)
|
317 | 317 | errmsg("invalid input syntax for type real: \"%s\"",
|
318 | 318 | orig_num)));
|
319 | 319 | }
|
| 320 | +#ifdefHAVE_BUGGY_SOLARIS_STRTOD |
| 321 | +else |
| 322 | +{ |
| 323 | +/* |
| 324 | + * Many versions of Solaris have a bug wherein strtod sets endptr |
| 325 | + * to point one byte beyond the end of the string when given |
| 326 | + * "inf" or "infinity". |
| 327 | + */ |
| 328 | +if (endptr!=num&&endptr[-1]=='\0') |
| 329 | +endptr--; |
| 330 | +} |
| 331 | +#endif/* HAVE_BUGGY_SOLARIS_STRTOD */ |
320 | 332 |
|
321 | 333 | /* skip trailing whitespace */
|
322 | 334 | while (*endptr!='\0'&&isspace((unsignedchar)*endptr))
|
@@ -482,6 +494,18 @@ float8in(PG_FUNCTION_ARGS)
|
482 | 494 | errmsg("invalid input syntax for type double precision: \"%s\"",
|
483 | 495 | orig_num)));
|
484 | 496 | }
|
| 497 | +#ifdefHAVE_BUGGY_SOLARIS_STRTOD |
| 498 | +else |
| 499 | +{ |
| 500 | +/* |
| 501 | + * Many versions of Solaris have a bug wherein strtod sets endptr |
| 502 | + * to point one byte beyond the end of the string when given |
| 503 | + * "inf" or "infinity". |
| 504 | + */ |
| 505 | +if (endptr!=num&&endptr[-1]=='\0') |
| 506 | +endptr--; |
| 507 | +} |
| 508 | +#endif/* HAVE_BUGGY_SOLARIS_STRTOD */ |
485 | 509 |
|
486 | 510 | /* skip trailing whitespace */
|
487 | 511 | while (*endptr!='\0'&&isspace((unsignedchar)*endptr))
|
|