summaryrefslogtreecommitdiff
path: root/lib/strtod.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-07-09 16:59:05 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-07-09 16:59:05 +0000
commitcb052e4f6cc723bc408f32963e921705f3286c94 (patch)
treed6f6172f7cff8f5c44f9ae557a525e4b1baf277b /lib/strtod.c
parent28edf6a75ef4f95e18da5b506bdcf122a53ca3ec (diff)
downloadcoreutils-cb052e4f6cc723bc408f32963e921705f3286c94.tar.xz
Update from gnulib.
Diffstat (limited to 'lib/strtod.c')
-rw-r--r--lib/strtod.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/strtod.c b/lib/strtod.c
index b8aab679e..73f01f974 100644
--- a/lib/strtod.c
+++ b/lib/strtod.c
@@ -22,16 +22,6 @@
#include <ctype.h>
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-#define TOLOWER(c) (IN_CTYPE_DOMAIN (c) ? tolower(c) : (c))
-
#include <math.h>
#include <float.h>
@@ -64,7 +54,7 @@ strtod (const char *nptr, char **endptr)
s = nptr;
/* Eat whitespace. */
- while (ISSPACE (*s))
+ while (isspace ((unsigned char) *s))
++s;
/* Get the sign. */
@@ -78,7 +68,7 @@ strtod (const char *nptr, char **endptr)
exponent = 0;
for (;; ++s)
{
- if (ISDIGIT (*s))
+ if ('0' <= *s && *s <= '9')
{
got_digit = 1;
@@ -111,7 +101,7 @@ strtod (const char *nptr, char **endptr)
if (!got_digit)
goto noconv;
- if (TOLOWER (*s) == 'e')
+ if (tolower ((unsigned char) *s) == 'e')
{
/* Get the exponent specified after the `e' or `E'. */
int save = errno;