summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/cbi.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-01-08 23:36:35 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-01-08 23:36:35 +0000
commit875baa244a7bcc147fe16d8b9242a19f13bafe11 (patch)
tree9e931266adc77e2ef1de6dc99203a0e1f61f4821 /libs/web/luasrc/cbi.lua
parent9fcdf0fe81f3c5142b8abd3f701dc3964549742a (diff)
libs/web: allow zero-length string literals when parsing datatypes
Diffstat (limited to 'libs/web/luasrc/cbi.lua')
-rw-r--r--libs/web/luasrc/cbi.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/web/luasrc/cbi.lua b/libs/web/luasrc/cbi.lua
index 88fb8a9b1f..e885e4e286 100644
--- a/libs/web/luasrc/cbi.lua
+++ b/libs/web/luasrc/cbi.lua
@@ -180,8 +180,8 @@ function compile_datatype(code)
if #label > 0 and tonumber(label) then
stack[#stack+1] = tonumber(label)
- elseif label:match("^'.+'$") or label:match('^".+"$') then
- stack[#stack+1] = label:gsub("[\"'](.+)[\"']", "%1")
+ elseif label:match("^'.*'$") or label:match('^".*"$') then
+ stack[#stack+1] = label:gsub("[\"'](.*)[\"']", "%1")
elseif type(datatypes[label]) == "function" then
stack[#stack+1] = datatypes[label]
stack[#stack+1] = { }