diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-08-10 11:00:18 +0300 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-08-10 11:00:18 +0300 |
commit | 8a597a484bbc121b64fdb5a118032136b3d9f1ba (patch) | |
tree | 9358323150307d3bac0207a7850a229a107f6153 /player | |
parent | e9e1c410607d527a649d60dc664f3c7cfae693d4 (diff) | |
download | mpv-8a597a484bbc121b64fdb5a118032136b3d9f1ba.tar.bz2 mpv-8a597a484bbc121b64fdb5a118032136b3d9f1ba.tar.xz |
lua: read_options: quote values at error messages
This makes it easier to understand the error in cases of incorrect
syntax or formatting at .conf files. (js already has this quoting).
Fixes #9105
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/options.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/player/lua/options.lua b/player/lua/options.lua index 1ea0d7226c..4517df2da4 100644 --- a/player/lua/options.lua +++ b/player/lua/options.lua @@ -15,14 +15,14 @@ local function typeconv(desttypeval, val) elseif val == "no" then val = false else - msg.error("Error: Can't convert " .. val .. " to boolean!") + msg.error("Error: Can't convert '" .. val .. "' to boolean!") val = nil end elseif type(desttypeval) == "number" then if not (tonumber(val) == nil) then val = tonumber(val) else - msg.error("Error: Can't convert " .. val .. " to number!") + msg.error("Error: Can't convert '" .. val .. "' to number!") val = nil end end @@ -92,7 +92,7 @@ local function read_options(options, identifier, on_update) -- match found values with defaults if option_types[key] == nil then msg.warn(conffilename..":"..linecounter.. - " unknown key " .. key .. ", ignoring") + " unknown key '" .. key .. "', ignoring") else local convval = typeconv(option_types[key], val) if convval == nil then |