projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9fcdf0f
)
libs/web: allow zero-length string literals when parsing datatypes
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 8 Jan 2012 23:36:35 +0000
(23:36 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 8 Jan 2012 23:36:35 +0000
(23:36 +0000)
libs/web/luasrc/cbi.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/cbi.lua
b/libs/web/luasrc/cbi.lua
index 88fb8a9b1f3ab6c8bf5c5f97ab570174850d2a18..e885e4e286189960ff4b871fedd20ce9a41b93df 100644
(file)
--- 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] = { }