summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-05 00:48:46 +0000
committerKarl Berry <karl@freefriends.org>2020-03-05 00:48:46 +0000
commitf210bce174e1f2f05305ab03e88e120a1cbfc4da (patch)
tree5c4e2ad096b5c745e859516ac3196fa0864292d5 /Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
parent35fd641a3546acc0c62e0aa7f134888e36da30d4 (diff)
context (from cont-tmf.zip of Feb 17 16:00, size 116339406)
git-svn-id: svn://tug.org/texlive/trunk@54086 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.lua41
1 files changed, 33 insertions, 8 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 62cf938ba4d..9b0679e250d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
@@ -61,13 +61,18 @@ function resolvers.uselibrary(specification) -- todo: reporter
if not foundname then
-- pattern based search
for i=1,#patterns do
- local wanted = format(patterns[i],barename)
- foundname = found(wanted)
- if trace_libraries then
- report_library("checking %a as %a: %s",filename,wanted,foundname or "not found")
- end
- if foundname then
- break
+ local pattern = patterns[i]
+ if pattern and pattern ~= "" then
+ local wanted = format(pattern,barename)
+ foundname = found(wanted)
+ if trace_libraries then
+ report_library("checking %a as %a: %s",filename,wanted,foundname or "not found")
+ end
+ if foundname then
+ break
+ end
+ else
+ -- can be a bogus path (coming from a test)
end
end
end
@@ -89,4 +94,24 @@ function resolvers.uselibrary(specification) -- todo: reporter
end
end
-commands.uselibrary = resolvers.uselibrary -- for the moment
+-- We keep these in the commands namespace even if it's not that logical
+-- but this way we are compatible.
+
+function commands.loadlibrary(name,foundname,nointerference)
+ if not foundname then
+ foundname = name
+ end
+ if foundname and foundname ~= "" then
+ if nointerference then
+ context.startnointerference()
+ end
+ context.startreadingfile()
+ context.input(foundname)
+ context.stopreadingfile()
+ if nointerference then
+ context.stopnointerference()
+ end
+ end
+end
+
+commands.uselibrary = resolvers.uselibrary