diff options
author | red-001 <red-001@outlook.ie> | 2018-01-21 12:28:47 +0000 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2018-02-08 15:38:34 +0100 |
commit | 1e94a7feaff940494a474ee549d4f2dc61f6a869 (patch) | |
tree | 59262c05efa356da015e4b04fc049db431c6dc95 /src | |
parent | 0e4c467a8248d1bd2cf658096f8476ce07c86c63 (diff) | |
download | minetest-1e94a7feaff940494a474ee549d4f2dc61f6a869.tar.gz minetest-1e94a7feaff940494a474ee549d4f2dc61f6a869.tar.bz2 minetest-1e94a7feaff940494a474ee549d4f2dc61f6a869.zip |
Move `setlocale` from Lua to C++.
Diffstat (limited to 'src')
-rw-r--r-- | src/script/cpp_api/s_base.cpp | 3 | ||||
-rw-r--r-- | src/script/cpp_api/s_security.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index 59107b3ff..f451156bd 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -118,6 +118,9 @@ ScriptApiBase::ScriptApiBase(ScriptingType type): lua_pushstring(m_luastack, porting::getPlatformName()); lua_setglobal(m_luastack, "PLATFORM"); + + // Make sure Lua uses the right locale + setlocale(LC_NUMERIC, "C"); } ScriptApiBase::~ScriptApiBase() diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index 690a3b47f..6c50218d3 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -261,8 +261,7 @@ void ScriptApiSecurity::initializeSecurityClient() "clock", "date", "difftime", - "time", - "setlocale", + "time" }; static const char *debug_whitelist[] = { "getinfo", |