diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-02-17 16:17:51 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-02-17 16:17:51 +0100 |
commit | 631a40d69d7fb4e5beff90039d21da5472dd1020 (patch) | |
tree | 8e9d9dc68c506fe309ccef784fe4b59853e98add /tex/context/base/mkiv/util-sac.lua | |
parent | 8e11d447440b44990432ac838953a8cde4ef914f (diff) | |
download | context-631a40d69d7fb4e5beff90039d21da5472dd1020.tar.gz |
2020-02-17 12:10:00
Diffstat (limited to 'tex/context/base/mkiv/util-sac.lua')
-rw-r--r-- | tex/context/base/mkiv/util-sac.lua | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tex/context/base/mkiv/util-sac.lua b/tex/context/base/mkiv/util-sac.lua index 19dc0eb0f..47c753ab1 100644 --- a/tex/context/base/mkiv/util-sac.lua +++ b/tex/context/base/mkiv/util-sac.lua @@ -263,9 +263,9 @@ function streams.readfixed2(f) f[2] = j + 1 local a, b = byte(f[1],i,j) if a >= 0x80 then - tonumber((a - 0x100) .. "." .. b) + return tonumber((a - 0x100) .. "." .. b) or 0 else - tonumber((a ) .. "." .. b) + return tonumber((a ) .. "." .. b) or 0 end end @@ -275,9 +275,9 @@ function streams.readfixed4(f) f[2] = j + 1 local a, b, c, d = byte(f[1],i,j) if a >= 0x80 then - tonumber((0x100 * a + b - 0x10000) .. "." .. (0x100 * c + d)) + return tonumber((0x100 * a + b - 0x10000) .. "." .. (0x100 * c + d)) or 0 else - tonumber((0x100 * a + b ) .. "." .. (0x100 * c + d)) + return tonumber((0x100 * a + b ) .. "." .. (0x100 * c + d)) or 0 end end @@ -366,16 +366,16 @@ if sio and sio.readcardinal2 then f[2] = i + 4 return readinteger4(f[1],i) end - -- function streams.readfixed2(f) -- needs recent luatex - -- local i = f[2] - -- f[2] = i + 2 - -- return readfixed2(f[1],i) - -- end - -- function streams.readfixed4(f) -- needs recent luatex - -- local i = f[2] - -- f[2] = i + 4 - -- return readfixed4(f[1],i) - -- end + function streams.readfixed2(f) -- needs recent luatex + local i = f[2] + f[2] = i + 2 + return readfixed2(f[1],i) + end + function streams.readfixed4(f) -- needs recent luatex + local i = f[2] + f[2] = i + 4 + return readfixed4(f[1],i) + end function streams.read2dot4(f) local i = f[2] f[2] = i + 2 |