diff options
| author | ruki <[email protected]> | 2024-01-30 23:56:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-01-30 23:56:53 +0800 |
| commit | 5c31fdb50c3230db5dd259d97285a8ac9e0fdf0c (patch) | |
| tree | 66d9ff6242c88265005f97c8ede227ab9965b264 /xmake/core/base/string.lua | |
| parent | 03e1525e1dca4849ab13fe9edb06bdbaaf932d42 (diff) | |
check string.split #4665
Diffstat (limited to 'xmake/core/base/string.lua')
| -rw-r--r-- | xmake/core/base/string.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua index 625678c6c..2b89f6550 100644 --- a/xmake/core/base/string.lua +++ b/xmake/core/base/string.lua @@ -80,6 +80,9 @@ end -- ("1.2.3.4.5"):split('%.', {limit = 3}) => 1, 2, 3.4.5 -- function string:split(delimiter, opt) + if #delimiter == 0 then + os.raise("string.split(%s, \"\") use empty delimiter", self) + end local limit, plain, strict if opt then limit = opt.limit |
