Fix the string.split bug by adding a new string.split2 function
parent
16109ec3f6
commit
d8df3b32da
|
@ -61,11 +61,14 @@ local BASE_ENV = {
|
|||
if separator == "" then separator = " " end
|
||||
return safer_lua.Array(unpack(string.split(str, separator, include_empty, max_splits, sep_is_pattern)))
|
||||
end,
|
||||
split2 = function(str, separator, include_empty, max_splits, sep_is_pattern)
|
||||
if separator == "" then separator = " " end
|
||||
return unpack(string.split(str, separator, include_empty, max_splits, sep_is_pattern))
|
||||
end,
|
||||
trim = string.trim,
|
||||
},
|
||||
tonumber = tonumber,
|
||||
tostring = tostring,
|
||||
unpack = unpack,
|
||||
type = type,
|
||||
ticks = 0,
|
||||
}
|
||||
|
|
2
init.lua
2
init.lua
|
@ -15,7 +15,7 @@
|
|||
safer_lua = {}
|
||||
|
||||
-- Version for compatibility checks, see readme.md/history
|
||||
safer_lua.version = 1.0
|
||||
safer_lua.version = 1.01
|
||||
|
||||
dofile(minetest.get_modpath("safer_lua") .. "/data_struct.lua")
|
||||
dofile(minetest.get_modpath("safer_lua") .. "/scanner.lua")
|
||||
|
|
|
@ -8,7 +8,7 @@ A subset of the language Lua for safe and secure Lua sandboxes with:
|
|||
- limited posibilities to call functions
|
||||
|
||||
### License
|
||||
Copyright (C) 2018-2020 Joachim Stolberg
|
||||
Copyright (C) 2018-2021 Joachim Stolberg
|
||||
Code: Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt
|
||||
|
||||
|
||||
|
@ -18,3 +18,4 @@ none
|
|||
### History
|
||||
- 2018-06-24 v0.01 * first draft
|
||||
- 2020-03-14 v1.00 * extracted from TechPack and released
|
||||
- 2021-11-28 v1.01 * function `string.split2` added, `unpack` removed
|
||||
|
|
Loading…
Reference in New Issue