diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2023-06-01 02:11:57 +0200 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2023-06-01 15:11:55 +0300 |
commit | 83acd93c6a48e6b47ca57c2ef4451a97531dc180 (patch) | |
tree | 05821589711d94ebebb92a65cb42c0b8b86ba868 /player | |
parent | f79458476b88e02c79ed6777941bb3a53f1e130a (diff) | |
download | mpv-83acd93c6a48e6b47ca57c2ef4451a97531dc180.tar.bz2 mpv-83acd93c6a48e6b47ca57c2ef4451a97531dc180.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/options.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/lua/options.lua b/player/lua/options.lua index a391844933..3b1bddf9ce 100644 --- a/player/lua/options.lua +++ b/player/lua/options.lua @@ -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 |