fix locale sensitivity of inexact-number parsing

Closes PR 12070
This commit is contained in:
Matthew Flatt 2011-12-28 19:03:04 -06:00
parent 00cd512e06
commit 580c952e46

View File

@ -1085,6 +1085,7 @@ Scheme_Object *scheme_read_number(const mzchar *str, intptr_t len,
{
/* We'd like to use strtod() for the common case, but we don't trust it entirely. */
char ffl_buf[MAX_FAST_FLOATREAD_LEN + 1];
GC_CAN_IGNORE char *loc;
{
int k;
@ -1100,8 +1101,13 @@ Scheme_Object *scheme_read_number(const mzchar *str, intptr_t len,
if (has_expt && (str[has_expt] != 'e' && str[has_expt] != 'E')) {
ffl_buf[has_expt - delta] = 'e';
}
loc = scheme_push_c_numeric_locale();
d = STRTOD(ffl_buf, &ptr);
scheme_pop_c_numeric_locale(loc);
if ((ptr XFORM_OK_MINUS ffl_buf) < (len - delta)) {
if (report)
scheme_read_err(complain, stxsrc, line, col, pos, span, 0, indentation,