summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-08-10 11:00:18 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2021-08-10 11:00:18 +0300
commit8a597a484bbc121b64fdb5a118032136b3d9f1ba (patch)
tree9358323150307d3bac0207a7850a229a107f6153
parente9e1c410607d527a649d60dc664f3c7cfae693d4 (diff)
downloadmpv-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
-rw-r--r--player/lua/options.lua6
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