summaryrefslogtreecommitdiff
path: root/tex/context/base/file-job.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-10-16 00:00:15 +0300
committerMarius <mariausol@gmail.com>2012-10-16 00:00:15 +0300
commiteb24ffd0c9851ab316455bca04fd9b23afe226e9 (patch)
tree62ebc304170e6b68acaacb6ebbd909f2f51b43a9 /tex/context/base/file-job.lua
parent26935233a6565bd73e53e2228ac98779fd3ab33d (diff)
downloadcontext-eb24ffd0c9851ab316455bca04fd9b23afe226e9.tar.gz
beta 2012.10.15 22:38
Diffstat (limited to 'tex/context/base/file-job.lua')
-rw-r--r--tex/context/base/file-job.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tex/context/base/file-job.lua b/tex/context/base/file-job.lua
index b62944abc..bced0b4d2 100644
--- a/tex/context/base/file-job.lua
+++ b/tex/context/base/file-job.lua
@@ -36,8 +36,10 @@ local basename = file.basename
local addsuffix = file.addsuffix
local removesuffix = file.removesuffix
local dirname = file.dirname
+local joinpath = file.join
local is_qualified_path = file.is_qualified_path
+local cleanpath = resolvers.cleanpath
local inputstack = resolvers.inputstack
local v_outer = variables.outer
@@ -551,9 +553,28 @@ function resolvers.jobs.currentenvironment() return topofstack(v_environment) en
local done = { }
local tolerant = false -- too messy, mkii user with the wrong sructure should adapt
+local function toppath()
+ local pathname = dirname(inputstack[#inputstack] or "")
+ if pathname == "" then
+ return "."
+ else
+ return pathname
+ end
+end
+
+resolvers.toppath = topath
+
+resolvers.prefixes.toppath = function(str)
+ local fullname = cleanpath(joinpath(toppath(),str))
+ return fullname
+end
+
local function process(what,name)
local depth = #typestack
local process
+ --
+ name = resolvers.resolve(name)
+ --
-- if not tolerant then
-- okay, would be best but not compatible with mkii
process = processors[currenttype][what]