summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-19 23:04:15 +0000
committerKarl Berry <karl@freefriends.org>2017-04-19 23:04:15 +0000
commitf74161ca4e7eb3c5af9afcbe92522ae3b58987c1 (patch)
tree3c30a13df5ac7968195c85070a2b074578e669d2 /Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
parent1d5a55ac8f5506a7ae9cfca52f4b588182e199d4 (diff)
context beta/cont-tmf.zip (Apr 16 12:55)
git-svn-id: svn://tug.org/texlive/trunk@43931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/file-lib.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-lib.lua24
1 files changed, 13 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
index 361608ea3cf..62cf938ba4d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
@@ -17,7 +17,6 @@ local trace_libraries = false trackers.register("resolvers.libraries", function
local report_library = logs.reporter("files","library")
----- report_files = logs.reporter("files","readfile")
-local suffixonly = file.suffix
local removesuffix = file.removesuffix
local getreadfilename = resolvers.getreadfilename
@@ -49,12 +48,7 @@ function resolvers.uselibrary(specification) -- todo: reporter
end
for i=1,#files do
local filename = files[i]
- if loaded[filename] then
- -- next one
- else
- if onlyonce then
- loaded[filename] = true -- todo: base this on return value
- end
+ if not loaded[filename] then
local foundname = nil
local barename = removesuffix(filename)
-- direct search (we have an explicit suffix)
@@ -77,10 +71,18 @@ function resolvers.uselibrary(specification) -- todo: reporter
end
end
end
- if foundname then
- action(name,foundname)
- elseif failure then
- failure(name)
+ if not loaded[foundname] then
+ if foundname then
+ action(name,foundname)
+ if onlyonce then
+ loaded[foundname] = true -- todo: base this on return value
+ end
+ elseif failure then
+ failure(name)
+ end
+ if onlyonce then
+ loaded[filename] = true -- todo: base this on return value
+ end
end
end
end