diff options
Diffstat (limited to 'tex/context/base/mkiv/libs-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/libs-ini.lua | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/libs-ini.lua b/tex/context/base/mkiv/libs-ini.lua index 5fc8ded98..7f1645b44 100644 --- a/tex/context/base/mkiv/libs-ini.lua +++ b/tex/context/base/mkiv/libs-ini.lua @@ -13,10 +13,10 @@ if not modules then modules = { } end modules ['libs-ini'] = { -- is doing. local type, unpack = type, unpack +local find = string.find -- here we implement the resolver -local type = type local nameonly = file.nameonly local joinfile = file.join @@ -196,3 +196,19 @@ end -- } -- end -- } + +local dofile = dofile +local savedrequire = require + +function require(name,version) + if find(name,"%.lua$") or find(name,"%.lmt$") then + local m = dofile(findfile(name)) + if m then + package.loaded[name] = m + return m + end + else + return savedrequire(name) + end +end + |