diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/file-res.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/file-res.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/context/base/file-res.lua b/Master/texmf-dist/tex/context/base/file-res.lua index 8e65ba4c7d1..9ae7a6b061b 100644 --- a/Master/texmf-dist/tex/context/base/file-res.lua +++ b/Master/texmf-dist/tex/context/base/file-res.lua @@ -6,13 +6,14 @@ if not modules then modules = { } end modules ['file-res'] = { license = "see context related readme files" } -local format = string.format +local format, find = string.format, string.find local isfile = lfs.isfile local is_qualified_path = file.is_qualified_path -local hasscheme = url.hasscheme +local hasscheme, urlescape = url.hasscheme, url.escape -local trace_files = false trackers.register("resolvers.readfile", function(v) trace_files = v end) -local report_files = logs.reporter("files","readfile") +local trace_files = false trackers.register("resolvers.readfile", function(v) trace_files = v end) +local trace_details = false trackers.register("resolvers.readfile.details", function(v) trace_details = v end) +local report_files = logs.reporter("files","readfile") resolvers.maxreadlevel = 2 @@ -23,6 +24,9 @@ local finders, loaders, openers = resolvers.finders, resolvers.loaders, resolver local found = { } -- can best be done in the resolver itself local function readfilename(specification,backtrack,treetoo) + if trace_details then + report_files(table.serialize(specification,"specification")) + end local name = specification.filename local fnd = name and found[name] if not fnd then @@ -132,9 +136,11 @@ function getreadfilename(scheme,path,name) -- better do a split and then pass ta if hasscheme(name) or is_qualified_path(name) then fullname = name else + if not find(name,"%",1,true) then + name = urlescape(name) -- if no % in names + end fullname = ((path == "") and format("%s:///%s",scheme,name)) or format("%s:///%s/%s",scheme,path,name) end ---~ print(">>>",fullname) return resolvers.findtexfile(fullname) or "" -- can be more direct end |