History

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.

Christoph Heinrich committed 3 years ago

Commit 83acd931 parent f7945841 file · +1 −1Browse files

Showing the changes to player/lua/options.lua (1 of 1 file). Show all

Unified · Split

player/lua/options.lua+1−1
@@ -110,7 +110,7 @@ local function read_options(options, identifier, on_update) · 109 unmodified lines
110110
111111 local function parse_opts(full, options)
112112 for key, val in pairs(full) do
113− if not (string.find(key, prefix, 1, true) == nil) then
113+ if string.find(key, prefix, 1, true) == 1 then
114114 key = string.sub(key, string.len(prefix)+1)
115115
116116 -- match found values with defaults

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t