summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2018-03-18 15:52:02 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2018-03-18 15:52:02 +0000
commitec642db685d98a9fa264511a5c5ae0786ac0339d (patch)
tree706fb7bdd6f4e8065733c1128b1c117d5cbc6def
parent741aa763521d0260ab326599fb143230705042e0 (diff)
downloadgitano-dsilvers/fix-272.tar.gz
LACE: Correct a bug in iterating table form valuesdsilvers/fix-272
When a tabular value is given to Lace, we assume that it is in 'set' form (i.e. the keys are the important thing to match against) and as such, we need to ensure we skip non-string keys since tables might be dual form (set, and list).
-rw-r--r--lib/gitano/lace.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua
index 685d625..3bea565 100644
--- a/lib/gitano/lace.lua
+++ b/lib/gitano/lace.lua
@@ -137,7 +137,10 @@ local function _do_simple_match(ctx, key, matchtype, value)
else
local ret = false
for k in pairs(kk) do
- ret = ret or check(value, k)
+ -- Only bother if the key is a string (set-form)
+ if type(k) == "string" then
+ ret = ret or check(value, k)
+ end
end
if matchtype:sub(1,1) == "!" then
ret = not ret