lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> but with Lua 5.2.0 beta-rc1, the two lines are concatenated in one

Indeed, there seems to be a \0 after the copyright line, but no \n.

Here is a simpler test:
	./lua -v  -e'print"hello"' > output
Now output contains a \0 before 'hello'.

The problem is this line in lua.c:

  luai_writestring(LUA_COPYRIGHT, sizeof(LUA_COPYRIGHT));

sizeof(LUA_COPYRIGHT) includes \0 so the correct line should be 

  luai_writestring(LUA_COPYRIGHT, sizeof(LUA_COPYRIGHT)-1);

Thanks for spotting this.