mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 10:02:17 +00:00
lua: read_options: find script-opts prefix at index 1 exactly
Finding the prefix in the key is not enough, the key has to actually start with the prefix. Otherwise a key like `uosc-font_scale` will not only match the `uosc-` prefix, but also the `osc-` prefix, resulting in a logged warning about `-font_scale` being an unknown key.
This commit is contained in:
parent
f79458476b
commit
83acd93c6a
@ -110,7 +110,7 @@ local function read_options(options, identifier, on_update)
|
||||
|
||||
local function parse_opts(full, options)
|
||||
for key, val in pairs(full) do
|
||||
if not (string.find(key, prefix, 1, true) == nil) then
|
||||
if string.find(key, prefix, 1, true) == 1 then
|
||||
key = string.sub(key, string.len(prefix)+1)
|
||||
|
||||
-- match found values with defaults
|
||||
|
Loading…
Reference in New Issue
Block a user