summaryrefslogtreecommitdiff
path: root/tex/context/base/data-pre.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/data-pre.lua')
-rw-r--r--tex/context/base/data-pre.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/tex/context/base/data-pre.lua b/tex/context/base/data-pre.lua
index 5cf5c93d5..26843d21c 100644
--- a/tex/context/base/data-pre.lua
+++ b/tex/context/base/data-pre.lua
@@ -35,6 +35,14 @@ prefixes.relative = function(str,n)
return resolvers.clean_path(str)
end
+prefixes.auto = function(str)
+ local fullname = prefixes.relative(str)
+ if not lfs.isfile(fullname) then
+ fullname = prefixes.locate(str)
+ end
+ return fullname
+end
+
prefixes.locate = function(str)
local fullname = resolvers.find_given_file(str) or ""
return resolvers.clean_path((fullname ~= "" and fullname) or str)