diff options
Diffstat (limited to 'scripts/context/lua/mtxrun.lua')
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 360a99fdc..0d8f3ac50 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -4133,7 +4133,9 @@ function boolean.tonumber(b) end function toboolean(str,tolerant) - if tolerant then + if str == true or str == false then + return str + elseif tolerant then local tstr = type(str) if tstr == "string" then return str == "true" or str == "yes" or str == "on" or str == "1" or str == "t" @@ -4894,6 +4896,9 @@ function table.fastserialize(t,prefix) end function table.deserialize(str) + if not str or str == "" then + return + end local code = loadstring(str) if not code then return |