summaryrefslogtreecommitdiff
path: root/tex/context/base/l-boolean.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2007-12-05 13:56:00 +0100
committerHans Hagen <pragma@wxs.nl>2007-12-05 13:56:00 +0100
commit6312e2b2913bc7de6f3c0ba30b993e2b4714edf1 (patch)
treee0e90382ddb930a0b4f534824892235b343dcdc4 /tex/context/base/l-boolean.lua
parent19af23ac5cb927d986a64ac1dc52ed2d7bad2450 (diff)
downloadcontext-6312e2b2913bc7de6f3c0ba30b993e2b4714edf1.tar.gz
stable 2007.12.05 13:56
Diffstat (limited to 'tex/context/base/l-boolean.lua')
-rw-r--r--tex/context/base/l-boolean.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/tex/context/base/l-boolean.lua b/tex/context/base/l-boolean.lua
index 098f0b3a1..66c608cee 100644
--- a/tex/context/base/l-boolean.lua
+++ b/tex/context/base/l-boolean.lua
@@ -13,11 +13,12 @@ end
function toboolean(str,tolerant)
if tolerant then
- if type(str) == "string" then
+ local tstr = type(str)
+ if tstr == "string" then
return str == "true" or str == "yes" or str == "on" or str == "1"
- elseif type(str) == "number" then
+ elseif tstr == "number" then
return tonumber(str) ~= 0
- elseif type(str) == "nil" then
+ elseif tstr == "nil" then
return false
else
return str