summaryrefslogtreecommitdiff
path: root/tex/context/base/mlib-run.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2014-07-17 13:24:00 +0200
committerHans Hagen <pragma@wxs.nl>2014-07-17 13:24:00 +0200
commite80c75029084c0e8a80286f78150b5a2e320e63c (patch)
tree6f58c4451079d5d54e0e5db1772a4ec4c67afcb5 /tex/context/base/mlib-run.lua
parentd091a10cf3c159a68967e4b50795481a223e652b (diff)
downloadcontext-e80c75029084c0e8a80286f78150b5a2e320e63c.tar.gz
beta 2014.07.17 13:24
Diffstat (limited to 'tex/context/base/mlib-run.lua')
-rw-r--r--tex/context/base/mlib-run.lua18
1 files changed, 14 insertions, 4 deletions
diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua
index 2a34f44d5..bd00cc260 100644
--- a/tex/context/base/mlib-run.lua
+++ b/tex/context/base/mlib-run.lua
@@ -106,14 +106,24 @@ end
mplib.preprocessed = preprocessed -- helper
+local function validftype(ftype)
+ if ftype == "" then
+ -- whatever
+ elseif ftype == 0 then
+ -- mplib bug
+ else
+ return ftype
+ end
+end
+
finders.file = function(specification,name,mode,ftype)
- return preprocessed(resolvers.findfile(name,ftype))
+ return preprocessed(resolvers.findfile(name,validftype(ftype)))
end
local function i_finder(name,mode,ftype) -- fake message for mpost.map and metafun.mpvi
local specification = url.hashed(name)
local finder = finders[specification.scheme] or finders.file
- return finder(specification,name,mode,ftype)
+ return finder(specification,name,mode,validftype(ftype))
end
local function o_finder(name,mode,ftype)
@@ -123,9 +133,9 @@ end
local function finder(name,mode,ftype)
if mode == "w" then
- return o_finder(name,mode,ftype)
+ return o_finder(name,mode,validftype(ftype))
else
- return i_finder(name,mode,ftype)
+ return i_finder(name,mode,validftype(ftype))
end
end