summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/luat-sta.lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-05-24 14:05:02 +0000
commit57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch)
tree1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/luat-sta.lua
parent6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff)
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/luat-sta.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/luat-sta.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/luat-sta.lua b/Master/texmf-dist/tex/context/base/luat-sta.lua
index 12fa18219bb..a81b0c206fc 100644
--- a/Master/texmf-dist/tex/context/base/luat-sta.lua
+++ b/Master/texmf-dist/tex/context/base/luat-sta.lua
@@ -7,6 +7,9 @@ if not modules then modules = { } end modules ['luat-sta'] = {
-- this code is used in the updater
+local gmatch, match = string.gmatch, string.match
+local type = type
+
states = states or { }
states.data = states.data or { }
states.hash = states.hash or { }
@@ -35,13 +38,17 @@ function states.set_by_tag(tag,key,value,default,persistent)
if d then
if type(d) == "table" then
local dkey, hkey = key, key
- local pre, post = key:match("(.+)%.([^%.]+)$")
+ local pre, post = match(key,"(.+)%.([^%.]+)$")
if pre and post then
- for k in pre:gmatch("[^%.]+") do
+ for k in gmatch(pre,"[^%.]+") do
local dk = d[k]
if not dk then
dk = { }
d[k] = dk
+ elseif type(dk) == "string" then
+ -- invalid table, unable to upgrade structure
+ -- hope for the best or delete the state file
+ break
end
d = dk
end
@@ -69,7 +76,7 @@ function states.get_by_tag(tag,key,default)
else
local d = states.data[tag]
if d then
- for k in key:gmatch("[^%.]+") do
+ for k in gmatch(key,"[^%.]+") do
local dk = d[k]
if dk then
d = dk