summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/data-pre.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/data-pre.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/data-pre.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/data-pre.lua b/Master/texmf-dist/tex/context/base/data-pre.lua
index 57905fa5e90..383ca291e97 100644
--- a/Master/texmf-dist/tex/context/base/data-pre.lua
+++ b/Master/texmf-dist/tex/context/base/data-pre.lua
@@ -24,6 +24,8 @@ local cleanpath, findgivenfile, expansion = resolvers.cleanpath, resolvers.findg
local getenv = resolvers.getenv -- we can probably also use resolvers.expansion
local P, Cs, lpegmatch = lpeg.P, lpeg.Cs, lpeg.match
+-- getenv = function(...) return resolvers.getenv(...) end -- needs checking (definitions changes later on)
+
prefixes.environment = function(str)
return cleanpath(expansion(str))
end
@@ -62,7 +64,7 @@ end
prefixes.filename = function(str)
local fullname = findgivenfile(str) or ""
- return cleanpath(file.basename((fullname ~= "" and fullname) or str))
+ return cleanpath(file.basename((fullname ~= "" and fullname) or str)) -- no cleanpath needed here
end
prefixes.pathname = function(str)
@@ -105,8 +107,9 @@ function resolvers.allprefixes(separator)
end
local function _resolve_(method,target)
- if prefixes[method] then
- return prefixes[method](target)
+ local action = prefixes[method]
+ if action then
+ return action(target)
else
return method .. ":" .. target
end
@@ -121,7 +124,7 @@ end
local function resolve(str) -- use schemes, this one is then for the commandline only
local res = resolved[str]
if not res then
- res = gsub(str,"([a-z][a-z]+):([^ \"\';]*)",_resolve_)
+ res = gsub(str,"([a-z][a-z]+):([^ \"\';]*)",_resolve_) -- home:xx;selfautoparent:xx; etc
resolved[str] = res
abstract[res] = str
end