summaryrefslogtreecommitdiffhomepage
path: root/core
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-04-22 18:01:41 +0000
committerSteven Barth <steven@midlink.org>2008-04-22 18:01:41 +0000
commitb15171305b5e6e9b1da4dc05c4d7e105980b9d9d (patch)
tree845bf294d49a616d0051c626fe3bd9d10656fe75 /core
parent187bbe4bbec7cb22c33df9c805c829e939892016 (diff)
* Fixed ffluci.util.trim, ffluci.util.split
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 9cb1e1420..3ff7bc203 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