diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-04-03 15:41:57 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-04-03 15:41:57 -0300 |
commit | 48d0674c2e85ef7bb447a8a45fbc6af80508f10e (patch) | |
tree | 9d7b34ea077dfbe155866c9b87ae47ba901b2a7e /llex.c | |
parent | 6ffe006f5c57321a9b3c12a246b142a0394bf62d (diff) | |
download | lua-48d0674c2e85ef7bb447a8a45fbc6af80508f10e.tar.gz lua-48d0674c2e85ef7bb447a8a45fbc6af80508f10e.tar.bz2 lua-48d0674c2e85ef7bb447a8a45fbc6af80508f10e.zip |
more consistent use of locale radix character across Lua
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.90 2015/03/03 18:17:04 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.91 2015/03/28 19:14:47 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -221,11 +221,6 @@ static void buffreplace (LexState *ls, char from, char to) { | |||
221 | } | 221 | } |
222 | 222 | ||
223 | 223 | ||
224 | #if !defined(l_getlocaledecpoint) | ||
225 | #define l_getlocaledecpoint() (localeconv()->decimal_point[0]) | ||
226 | #endif | ||
227 | |||
228 | |||
229 | #define buff2num(b,o) (luaO_str2num(luaZ_buffer(b), o) != 0) | 224 | #define buff2num(b,o) (luaO_str2num(luaZ_buffer(b), o) != 0) |
230 | 225 | ||
231 | /* | 226 | /* |
@@ -234,7 +229,7 @@ static void buffreplace (LexState *ls, char from, char to) { | |||
234 | */ | 229 | */ |
235 | static void trydecpoint (LexState *ls, TValue *o) { | 230 | static void trydecpoint (LexState *ls, TValue *o) { |
236 | char old = ls->decpoint; | 231 | char old = ls->decpoint; |
237 | ls->decpoint = l_getlocaledecpoint(); | 232 | ls->decpoint = lua_getlocaledecpoint(); |
238 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ | 233 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ |
239 | if (!buff2num(ls->buff, o)) { | 234 | if (!buff2num(ls->buff, o)) { |
240 | /* format error with correct decimal point: no more options */ | 235 | /* format error with correct decimal point: no more options */ |