mirror of
https://github.com/mpv-player/mpv
synced 2025-02-03 05:31:34 +00:00
stats.lua: page 4 (keys): detect single-quotes
This commit is contained in:
parent
9f6cbf3a4d
commit
8b1930fbd6
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user