Comparison

mod_firewall/mod_firewall.lua @ 2584:d64fc9c3cffd

mod_firewall: Remove ambiguity from tokens dep parameter
author Matthew Wild <mwild1@gmail.com>
date Sun, 26 Feb 2017 09:50:16 +0000
parent 2583:b6b10f57aa56
child 2585:02c6ae745c4f
comparison
equal deleted inserted replaced
2583:b6b10f57aa56 2584:d64fc9c3cffd
235 return ("local pattern_%s = %q"):format(pattern_name, pattern); 235 return ("local pattern_%s = %q"):format(pattern_name, pattern);
236 end; 236 end;
237 }; 237 };
238 tokens = { 238 tokens = {
239 local_code = function (search_and_pattern) 239 local_code = function (search_and_pattern)
240 local search_name, pattern_name = search_and_pattern:match("^([^%-]+)_(.+)$"); 240 local search_name, pattern_name = search_and_pattern:match("^([^%-]+)-(.+)$");
241 local code = ([[local tokens_%s_%s = {}; 241 local code = ([[local tokens_%s_%s = {};
242 if search_%s then 242 if search_%s then
243 for s in search_%s:gmatch(pattern_%s) do 243 for s in search_%s:gmatch(pattern_%s) do
244 tokens_%s_%s[s] = true; 244 tokens_%s_%s[s] = true;
245 end 245 end