diff options
author | red-001 <red-001@outlook.ie> | 2018-01-21 12:28:47 +0000 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2018-06-03 17:32:00 +0200 |
commit | bb28afcfc337b73bff2b46ff1a1b8844e035c96e (patch) | |
tree | a49abfb88cca3c22fe61d2f3a6aed3818f0c42d9 /src/script/cpp_api | |
parent | 880a25c92182bd10e8a80930909cf505e851ea65 (diff) | |
download | minetest-bb28afcfc337b73bff2b46ff1a1b8844e035c96e.tar.gz minetest-bb28afcfc337b73bff2b46ff1a1b8844e035c96e.tar.bz2 minetest-bb28afcfc337b73bff2b46ff1a1b8844e035c96e.zip |
Move `setlocale` from Lua to C++.
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_base.cpp | 3 | ||||
-rw-r--r-- | src/script/cpp_api/s_security.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index 2537d895f..c75b1c2f8 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -119,6 +119,9 @@ ScriptApiBase::ScriptApiBase() : m_environment = NULL; m_guiengine = NULL; + + // 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 5ad7947d5..66a761f4c 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -249,9 +249,8 @@ void ScriptApiSecurity::initializeSecurityClient() static const char *os_whitelist[] = { "clock", "date", - "difftime", - "time", - "setlocale", + "difftime", + "time" }; static const char *debug_whitelist[] = { "getinfo", |