diff options
author | Marius <mariausol@gmail.com> | 2010-09-03 12:35:26 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-09-03 12:35:26 +0300 |
commit | 16895587e51f8243a7e4dc6185979894fb199d4f (patch) | |
tree | 923fe9fe4d34a11202e06a4258ba71bab6ccde8d /tex/context/base/l-io.lua | |
parent | 20da4ce347921be291c8804041bd8756e3bf1707 (diff) | |
download | context-16895587e51f8243a7e4dc6185979894fb199d4f.tar.gz |
beta 2010.09.03 11:05
Diffstat (limited to 'tex/context/base/l-io.lua')
-rw-r--r-- | tex/context/base/l-io.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tex/context/base/l-io.lua b/tex/context/base/l-io.lua index cf8852fd6..fe988b107 100644 --- a/tex/context/base/l-io.lua +++ b/tex/context/base/l-io.lua @@ -186,7 +186,7 @@ function io.ask(question,default,options) end end -function io.readnumber(f,n,m) +local function readnumber(f,n,m) if m then f:seek("set",n) n = m @@ -198,18 +198,20 @@ function io.readnumber(f,n,m) return 256*a + b elseif n == 4 then local a, b, c, d = byte(f:read(4),1,4) - return 256^3 * a + 256^2 * b + 256*c + d + return 256*256*256 * a + 256*256 * b + 256*c + d elseif n == 8 then local a, b = readnumber(f,4), readnumber(f,4) - return 256 * b + c + return 256 * a + b elseif n == 12 then local a, b, c = readnumber(f,4), readnumber(f,4), readnumber(f,4) - return 256^2 * a + 256 * b + c + return 256*256 * a + 256 * b + c else return 0 end end +io.readnumber = readnumber + function io.readstring(f,n,m) if m then f:seek("set",n) |