summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/strtod.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2002-04-17 12:01:21 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2002-04-17 12:01:21 +0000
commit3fff6ffc1a0d4131c475b6eda1b426d5bb9818a6 (patch)
treeca09e6e77405f38cffbc4a74b062541b77cad9a6 /lib/libc/stdlib/strtod.c
parentf03a550f332fc289526f7b762e876090435925be (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/strtod.c')
-rw-r--r--lib/libc/stdlib/strtod.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c
index 677090483233..f8ed1c3df610 100644
--- a/lib/libc/stdlib/strtod.c
+++ b/lib/libc/stdlib/strtod.c
@@ -134,6 +134,7 @@ static char sccsid[] = "@(#)strtod.c 8.1 (Berkeley) 6/4/93";
#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
#endif
+#include <locale.h>
#ifdef __cplusplus
#include "malloc.h"
#include "memory.h"
@@ -1193,6 +1194,8 @@ strtod
long L;
unsigned long y, z;
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
+ char decimal_point = localeconv()->decimal_point[0];
+
sign = nz0 = nz = 0;
rv = 0.;
for (s = s00;;s++) switch(*s) {
@@ -1226,7 +1229,7 @@ strtod
else if (nd < 16)
z = 10*z + c - '0';
nd0 = nd;
- if (c == '.') {
+ if ((char)c == decimal_point) {
c = *++s;
if (!nd) {
for (; c == '0'; c = *++s)