From ee7d0c26493e1303a06f45b28ee2822c5a6aff05 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 26 May 2011 13:09:40 -0300 Subject: new macro 'luai_writeline' to print newlines (and flush 'stdout') --- lbaselib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 67edd96e..eb06df4e 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.259 2011/01/26 16:30:02 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.260 2011/02/28 17:32:10 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -32,13 +32,13 @@ static int luaB_print (lua_State *L) { lua_call(L, 1, 1); s = lua_tolstring(L, -1, &l); /* get result */ if (s == NULL) - return luaL_error(L, LUA_QL("tostring") " must return a string to " - LUA_QL("print")); + return luaL_error(L, + LUA_QL("tostring") " must return a string to " LUA_QL("print")); if (i>1) luai_writestring("\t", 1); luai_writestring(s, l); lua_pop(L, 1); /* pop result */ } - luai_writestring("\n", 1); + luai_writeline(); return 0; } -- cgit v1.2.3-55-g6feb