diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua | 72 |
1 files changed, 11 insertions, 61 deletions
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua index 6e1b31e9610..35005d1c885 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-core.lua @@ -1,21 +1,18 @@ -- luatex-core security and io overloads ........... -- if not modules then modules = { } end modules ['luatex-core'] = { --- version = 1.080, +-- version = 1.005, -- comment = 'companion to luatex', -- author = 'Hans Hagen & Luigi Scarso', -- copyright = 'LuaTeX Development Team', -- } -LUATEXCOREVERSION = 1.080 -- we reflect the luatex version where changes happened +LUATEXCOREVERSION = 1.005 -- This file overloads some Lua functions. The readline variants provide the same -- functionality as LuaTeX <= 1.04 and doing it this way permits us to keep the -- original io libraries clean. Performance is probably even a bit better now. --- We test for functions already being defined so that we don't overload ones that --- are provided in the startup script. - local type, next, getmetatable, require = type, next, getmetatable, require local find, gsub, format = string.find, string.gsub, string.format @@ -54,7 +51,7 @@ local function luatex_io_open(name,how) end local function luatex_io_open_readonly(name,how) - if not how then + if how then how = 'r' else how = gsub(how,'[^rb]','') @@ -174,8 +171,6 @@ if saferoption == 1 then lfs.rmdir = installdummy("lfs.rmdir") lfs.mkdir = installdummy("lfs.mkdir") - debug = nil - end if saferoption == 1 or shellescape ~= 1 then @@ -200,20 +195,16 @@ if md5 then local format = string.format local byte = string.byte - if not md5.sumhexa then - function md5.sumhexa(k) - return (gsub(sum(k), ".", function(c) - return format("%02x",byte(c)) - end)) - end + function md5.sumhexa(k) + return (gsub(sum(k), ".", function(c) + return format("%02x",byte(c)) + end)) end - if not md5.sumHEXA then - function md5.sumHEXA(k) - return (gsub(sum(k), ".", function(c) - return format("%02X",byte(c)) - end)) - end + function md5.sumHEXA(k) + return (gsub(sum(k), ".", function(c) + return format("%02X",byte(c)) + end)) end end @@ -376,47 +367,6 @@ do if not loaded.socket then loaded.socket = loaded["socket.core"] end if not loaded.mime then loaded.mime = loaded["mime.core"] end - if not loaded.lfs then loaded.lfs = lfs end - -end - -do - - local lfsattributes = lfs.attributes - local symlinkattributes = lfs.symlinkattributes - - -- these can now be done using lfs (was dead slow before) - - if not lfs.isfile then - function lfs.isfile(name) - local m = lfsattributes(name,"mode") - return m == "file" or m == "link" - end - end - - if not lfs.isdir then - function lfs.isdir(name) - local m = lfsattributes(name,"mode") - return m == "directory" - end - end - - -- shortnames have also be sort of dropped from kpse - - if not lfs.shortname then - function lfs.shortname(name) - return name - end - end - - -- now there is a target field, so ... - - if not lfs.readlink then - function lfs.readlink(name) - return symlinkattributes(name,"target") or nil - end - end - end -- so far |