diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-07-20 11:09:33 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-07-20 11:09:33 +0200 |
commit | 81095dd1bf20eb5f7e126adbdc8047f940504180 (patch) | |
tree | c0cdf7b074e8a2d00c56fde09519e89f155bd425 /tex/context/base/mkiv/libs-ini.lua | |
parent | f1129626606384a7a55a21a83531f51f8b5dee25 (diff) | |
download | context-81095dd1bf20eb5f7e126adbdc8047f940504180.tar.gz |
2020-07-20 10:42:00
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 + |