summaryrefslogtreecommitdiff
path: root/xmake/core/base/string.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-30 23:56:53 +0800
committerruki <[email protected]>2024-01-30 23:56:53 +0800
commit5c31fdb50c3230db5dd259d97285a8ac9e0fdf0c (patch)
tree66d9ff6242c88265005f97c8ede227ab9965b264 /xmake/core/base/string.lua
parent03e1525e1dca4849ab13fe9edb06bdbaaf932d42 (diff)
check string.split #4665
Diffstat (limited to 'xmake/core/base/string.lua')
-rw-r--r--xmake/core/base/string.lua3
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