summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-09-25 23:00:14 +0300
committerMarius <mariausol@gmail.com>2012-09-25 23:00:14 +0300
commit8ae17f2c95dc1d7a5595f9f2d8ec91e61cd37e28 (patch)
tree72ea78818c4cbc8f573586c304454a62b0e326a4 /scripts
parentcef5e3d62b5db1988c912a1166e26e40f2c0d4ae (diff)
downloadcontext-8ae17f2c95dc1d7a5595f9f2d8ec91e61cd37e28.tar.gz
beta 2012.09.25 21:44
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtxrun.lua7
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua7
-rw-r--r--scripts/context/stubs/unix/mtxrun7
3 files changed, 18 insertions, 3 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
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 360a99fdc..0d8f3ac50 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/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
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 360a99fdc..0d8f3ac50 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -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