mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Error when string.split is given empty separator (#13132)
This commit is contained in:
parent
a3177b89d8
commit
ab1fe80150
3 changed files with 10 additions and 1 deletions
|
@ -170,6 +170,9 @@ end
|
|||
--------------------------------------------------------------------------------
|
||||
function string.split(str, delim, include_empty, max_splits, sep_is_pattern)
|
||||
delim = delim or ","
|
||||
if delim == "" then
|
||||
error("string.split separator is empty", 2)
|
||||
end
|
||||
max_splits = max_splits or -2
|
||||
local items = {}
|
||||
local pos, len = 1, #str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue