From e4cc8e42daf9c69dfcb264652037bc089c1790c6 Mon Sep 17 00:00:00 2001 From: the lemons Date: Tue, 1 Mar 2022 16:51:35 -0600 Subject: permit underscores and dashes in flag names --- zzcxz.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zzcxz.cgi b/zzcxz.cgi index 72bdee5..54f2a7f 100755 --- a/zzcxz.cgi +++ b/zzcxz.cgi @@ -170,7 +170,7 @@ local function parse_directive(line, directives, tmp_flags) directives.redirect = redirect elseif directive == "set" then if args:match "^%s*$" then return end - local flagname, text = args:match "^%s*(%w+)%s*(.-)%s*$" + local flagname, text = args:match "^%s*([%w%-_]+)%s*(.-)%s*$" if not flagname then return end text = text or "" if utf8.len(flagname) > 150 or utf8.len(text) > 1000 then @@ -179,12 +179,12 @@ local function parse_directive(line, directives, tmp_flags) directives.flags_updated[flagname] = text tmp_flags[flagname] = text elseif directive == "unset" then - local flagname = args:match "^%s*(%w+)%s*$" + local flagname = args:match "^%s*([%w%-_]+)%s*$" if not flagname then return end directives.flags_updated[flagname] = false tmp_flags[flagname] = nil elseif directive == "require" then - local flagname = args:match "^%s*(%w+)%s*$" + local flagname = args:match "^%s*([%w%-_]+)%s*$" if not flagname then return end directives.require[flagname] = true else -- cgit v1.2.3