[NTG-context] problem with lua io.lines

Hans Hagen pragma at wxs.nl
Wed Aug 14 17:12:20 CEST 2013


On 8/14/2013 5:00 PM, Hans Hagen wrote:
> On 8/14/2013 4:43 PM, Henning Hraban Ramm wrote:
>>
>> Am 2013-08-14 um 20:15 schrieb Wolfgang Schuster
>> <schuster.wolfgang at gmail.com>:
>>
>>>> Current beta MkIV seems to have a bug in the Lua function io.lines:

btw, it's a lua issue, not related to luatex ...

local myfile = "myfile.txt"

for myline in io.lines(myfile) do
     logs.report("test 1",myline)
end

for myline in io.lines(myfile,3) do
     logs.report("test 2",myline)
end

for myline in io.lines(myfile,1) do
     logs.report("test 2",myline)
end

for myline in io.lines(myfile,0) do
     logs.report("test 2",myline)
end

for myline in io.lines(myfile,-1) do
     logs.report("test 2",myline)
end

the zero case loops and the last case gives a "memory allocation error: 
block too big" so these can be considered buglets in lua

Hans

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------


More information about the ntg-context mailing list