From 8a597a484bbc121b64fdb5a118032136b3d9f1ba Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Tue, 10 Aug 2021 11:00:18 +0300 Subject: 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 --- player/lua/options.lua | 6 +++--- 1 file 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 -- cgit v1.2.3