From 0da55392b876cef55845157c4bfb8244d84c6450 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 1 Mar 2017 13:51:17 +0100 Subject: 2017-03-01 13:47:00 --- tex/context/base/mkiv/util-lib.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'tex/context/base/mkiv/util-lib.lua') diff --git a/tex/context/base/mkiv/util-lib.lua b/tex/context/base/mkiv/util-lib.lua index e9a968228..98c417b8e 100644 --- a/tex/context/base/mkiv/util-lib.lua +++ b/tex/context/base/mkiv/util-lib.lua @@ -327,15 +327,21 @@ We use the same lookup logic for ffi loading. trackers.register("resolvers.ffilib", function(v) trace_ffilib = v end) + local function locateindeed(name) + local message, library = pcall(savedffiload,removesuffix(name)) + if type(library) == "userdata" then + return library + else + return false + end + end + function ffilib(required,version) - return locate(required,version,trace_ffilib,report_ffilib,function(name) - local message, library = pcall(savedffiload,removesuffix(name)) - if type(library) == "userdata" then - return message, library - else - return message, false - end - end) + if version == "system" then + return locateindeed(name) + else + return locate(required,version,trace_ffilib,report_ffilib,locateindeed) + end end function ffi.load(name) -- cgit v1.2.3