aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2022-03-01 16:51:35 -0600
committerthe lemons <citrons@mondecitronne.com>2022-03-01 16:51:35 -0600
commite4cc8e42daf9c69dfcb264652037bc089c1790c6 (patch)
treed09e60a601af6a3afb14ce58803c5653bc4aa2b5
parent1d2e81782afb3addad4d7a47cc8a906006e1370b (diff)
permit underscores and dashes in flag names
-rwxr-xr-xzzcxz.cgi6
1 files 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