diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-09-03 11:05:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-09-03 11:05:00 +0200 |
commit | 0da1a7a94f55a5dc0d318f399eb843303d5b62f6 (patch) | |
tree | b5493406b2f6d8954204b532df5549acbc4baee8 /tex/context/base/l-io.lua | |
parent | bbc8970958af29626335568414a4278d852e086f (diff) | |
download | context-0da1a7a94f55a5dc0d318f399eb843303d5b62f6.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) |