summaryrefslogtreecommitdiffhomepage
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ffluci/util.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/ffluci/util.lua b/core/src/ffluci/util.lua
index 9cb1e1420c..3ff7bc2033 100644
--- a/core/src/ffluci/util.lua
+++ b/core/src/ffluci/util.lua
@@ -153,6 +153,10 @@ function split(str, pat, max, regex)
local t = {}
local c = 1
+ if #str == 0 then
+ return {""}
+ end
+
if #pat == 0 then
return nil
end
@@ -172,8 +176,9 @@ function split(str, pat, max, regex)
end
-- Removes whitespace from beginning and end of a string
-function trim (string)
- return string:gsub("^%s*(.-)%s*$", "%1")
+function trim(string)
+ local s = string:gsub("^%s*(.-)%s*$", "%1")
+ return s
end
-- Updates given table with new values