Re: [NTG-context] io.readnumber / l-io.lua (with patch)

2010-08-30 Thread Hans Hagen

On 30-8-2010 2:11, Philipp Gesang wrote:

Hi, the function io.readnumber fails to call itself. I append a
patch. Philipp

ok

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] io.readnumber / l-io.lua (with patch)

2010-08-30 Thread Philipp Gesang
Hi, the function io.readnumber fails to call itself. I append a
patch. Philipp

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
--- l-io.lua2010-08-18 17:37:25.0 +0200
+++ /home/laokoon/versuche/lua/dok/examples/io/l-io.lua 2010-08-30 
14:01:02.0 +0200
@@ -186,7 +186,7 @@
 end
 end
 
-function io.readnumber(f,n,m)
+local function readnumber(f,n,m)
 if m then
 f:seek("set",n)
 n = m
@@ -201,7 +201,7 @@
 return 256^3 * a + 256^2 * 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
@@ -210,6 +210,8 @@
 end
 end
 
+io.readnumber = readnumber
+
 function io.readstring(f,n,m)
 if m then
 f:seek("set",n)


pgpZTnghth5Y4.pgp
Description: PGP signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___