diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-11-21 16:40:21 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-11-21 16:40:21 +0100 |
commit | 666a3482a5a24f93cf691b7b38c395241d38b34c (patch) | |
tree | 8f1e60cd8accd94c73e1978777f02910e19e7ef3 /newlib/libc | |
parent | 63613c3cb029c1b9f54921d530f1c7072b88bc36 (diff) | |
download | newlib-666a3482a5a24f93cf691b7b38c395241d38b34c.zip newlib-666a3482a5a24f93cf691b7b38c395241d38b34c.tar.gz newlib-666a3482a5a24f93cf691b7b38c395241d38b34c.tar.bz2 |
Handle multibyte decimapl point in strtold.
* libc/stdlib/strtodg.c: Define USE_LOCALE.
(_strtodg_r): Handle multibyte decimal point.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/stdlib/strtodg.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/strtodg.c b/newlib/libc/stdlib/strtodg.c index 70ec179..594238a 100644 --- a/newlib/libc/stdlib/strtodg.c +++ b/newlib/libc/stdlib/strtodg.c @@ -39,6 +39,8 @@ THIS SOFTWARE. #include "locale.h" +#define USE_LOCALE + static const int fivesbits[] = { 0, 3, 5, 7, 10, 12, 14, 17, 19, 21, 24, 26, 28, 31, 33, 35, 38, 40, 42, 45, @@ -516,13 +518,18 @@ _strtodg_r z = 10*z + c - '0'; nd0 = nd; #ifdef USE_LOCALE - if (c == *localeconv()->decimal_point) + if (strncmp (s, _localeconv_r (p)->decimal_point, + strlen (_localeconv_r (p)->decimal_point)) == 0) #else if (c == '.') #endif { decpt = 1; +#ifdef USE_LOCALE + c = *(s += strlen (_localeconv_r (p)->decimal_point)); +#else c = *++s; +#endif if (!nd) { for(; c == '0'; c = *++s) nz++; |