X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fstrtod.c;h=def37ca26f4a1625d7a52a5b6e26eca6c662be67;hb=585a8dcf51a46cd9965c6881cfff6eddbae06d48;hp=b642589e36b9e44dbc886704568f7c8e341f066b;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/strtod.c b/lib/strtod.c index b642589e3..def37ca26 100644 --- a/lib/strtod.c +++ b/lib/strtod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2011 Free Software +/* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -149,7 +149,7 @@ parse_number (const char *nptr, else { /* The value of the digit doesn't matter, since we have already - gotten as many digits as can be represented in a `double'. + gotten as many digits as can be represented in a 'double'. This doesn't necessarily mean the result will overflow. The exponent may reduce it to within range. @@ -193,7 +193,7 @@ static double underlying_strtod (const char *, char **); /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. ICC 10.0 has a bug when optimizing the expression -zero. The expression -DBL_MIN * DBL_MIN does not work when cross-compiling - to PowerPC on MacOS X 10.5. */ + to PowerPC on Mac OS X 10.5. */ #if defined __hpux || defined __sgi || defined __ICC static double compute_minus_zero (void) @@ -303,6 +303,7 @@ strtod (const char *nptr, char **endptr) && c_tolower (s[4]) == 'y') s += 5; num = HUGE_VAL; + errno = saved_errno; } else if (c_tolower (*s) == 'n' && c_tolower (s[1]) == 'a' @@ -325,6 +326,7 @@ strtod (const char *nptr, char **endptr) to interpreting n-char-sequence as a hexadecimal number. */ if (s != end) num = NAN; + errno = saved_errno; } else {