Extend table tags if neccessary in sfnt handling

This commit is contained in:
Marcel Krüger 2020-07-23 09:01:03 +02:00
parent 537ff4d551
commit 7d82c7b9d1
2 changed files with 6 additions and 3 deletions

View File

@ -41,7 +41,7 @@ return {
write = function(magic, tables)
local tabdata = {}
for t, val in next, tables do
tabdata[#tabdata+1] = {t, val .. string.rep("\0", (#val+3&~3)-#val), #val}
tabdata[#tabdata+1] = {string.format("%-4s", t), val .. string.rep("\0", (#val+3&~3)-#val), #val}
end
table.sort(tabdata, function(a,b)return a[1]<b[1]end)
local logtabs = log2floor(#tabdata)

View File

@ -19,9 +19,11 @@ local arg_pattern, late_arg_pattern do
if os.type == 'windows' then
-- Windows: " -> "^"" The ^ is for cmd escaping, the """ is for command line splitting escaping,
-- backslashes still have to be escaped, but only in front of " or \
-- Additionally, "%" always as to be escaped for some variable substitution
-- pass before everything else.
-- WARNING: This works with luametatex's argument splitting, but don't generally rely
-- on it for other Windows programs. There are two standard Windows ways which are incompatible...
escape = '\\' * #l.S'\\"' * l.Cc'\\' + '"' * l.Cc'^""' + 1
escape = '\\' * #l.S'\\"' * l.Cc'\\' + '"' * l.Cc'^""' + '%' * l.Cc'%' + 1
else
-- POSIX: We escape with single quotes, so only single quotes need escaping
escape = "'" * l.Cc"\\''" + 1
@ -45,7 +47,8 @@ local kpse_call = io.popen(string.format("kpsewhich -progname%s -format lua -all
local file
repeat
file = kpse_call:read()
until not file:match('^%.')
until not assert(file, "Unable to find initialization script. Aborting."):match('^%.')
if not kpse_call:close() then
error(file)
end