diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-14 19:58:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-14 19:58:50 +0200 |
commit | fd0c4577a4b6e85ca2db664906e1a03807ce133f (patch) | |
tree | fa23fcc04248d03ff82e34634b8ef1bb9cf28acb /tex/context/base/mkiv/file-lib.lua | |
parent | db581096187dc2d3cbdbe4cdc39d247c168b1607 (diff) | |
download | context-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz |
2017-05-14 19:15:00
Diffstat (limited to 'tex/context/base/mkiv/file-lib.lua')
-rw-r--r-- | tex/context/base/mkiv/file-lib.lua | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/file-lib.lua b/tex/context/base/mkiv/file-lib.lua index 361608ea3..62cf938ba 100644 --- a/tex/context/base/mkiv/file-lib.lua +++ b/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 |