aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2023-09-05 02:21:34 +0000
committerKyle Evans <kevans@FreeBSD.org>2023-09-12 01:48:51 +0000
commit380f42e2ed3627d47696a1409a1a3ea07aebff17 (patch)
tree5de566ccc70fd64eea3c6d970714332e4b275111
parent34cffc25b7207331e104dc561bdd2097fef6e661 (diff)
downloadsrc-380f42e2ed3627d47696a1409a1a3ea07aebff17.tar.gz
src-380f42e2ed3627d47696a1409a1a3ea07aebff17.zip
stand: lua: module names should permit more
The module entries should generally allow whatever is allowed as an env_var in the pattern table. Notably, we're missing periods which would allow proper entries for .dtb files in loader.conf that don't need to specify a module_name entry for it. %d in this expression is actually redundant as %w is actually "all alphanumerics," but I've included it for now to match the env_var entry. We should really remove it from both. Reported by: "aribi" on the forums via allanjude@ Approved by: re (gjb) (cherry picked from commit 5bc1e0c2285e73fe8455bb6c72b2b40e33f5477e) (cherry picked from commit 6b2f0a3c31dbf9268b49d64c859da136ca8dc201)
-rw-r--r--stand/lua/config.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/stand/lua/config.lua b/stand/lua/config.lua
index 3f8fbc52cb40..8fdc805ee983 100644
--- a/stand/lua/config.lua
+++ b/stand/lua/config.lua
@@ -61,7 +61,10 @@ local MSG_FAILSYN_EOLESC = "Stray escape at end of line"
local MSG_FAILSYN_EOLVAR = "Unescaped $ at end of line"
local MSG_FAILSYN_BADVAR = "Malformed variable expression at position '%d'"
-local MODULEEXPR = '([-%w_]+)'
+-- MODULEEXPR should more or less allow the exact same set of characters as the
+-- env_var entries in the pattern table. This is perhaps a good target for a
+-- little refactoring.
+local MODULEEXPR = '([%w%d-_.]+)'
local QVALEXPR = '"(.*)"'
local QVALREPL = QVALEXPR:gsub('%%', '%%%%')
local WORDEXPR = "([-%w%d][-%w%d_.]*)"