From 8b1930fbd69d5d911f38918cdd5c6936b8941b0e Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Wed, 28 Jul 2021 13:43:57 +0300 Subject: stats.lua: page 4 (keys): detect single-quotes --- player/lua/stats.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'player/lua') diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 7883583461..2c906a6e32 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -386,10 +386,10 @@ local name_prefixes = { -- It's decent in practice, and worst case is "incorrect" subject. local function cmd_subject(cmd) cmd = cmd:gsub(";.*", ""):gsub("%-", "_") -- only first cmd, s/-/_/ - local TOKEN = '^%s*"?([%w_!]*)' -- captures+ends before a (maybe) final " + local TOKEN = '^%s*["\']?([%w_!]*)' -- captures+ends before (maybe) final " local tok, sname, subw - repeat tok, cmd = cmd:match(TOKEN .. '"?(.*)') + repeat tok, cmd = cmd:match(TOKEN .. '["\']?(.*)') until not cmd_prefixes[tok] -- tok is the 1st non-generic command/property name token, cmd is the rest -- cgit v1.2.3