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') --- lua.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lua.c') diff --git a/lua.c b/lua.c index 46783fc2..5b582824 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.197 2011/03/14 15:39:42 roberto Exp roberto $ +** $Id: lua.c,v 1.198 2011/05/03 16:01:57 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -183,7 +183,8 @@ static int docall (lua_State *L, int narg, int nres) { static void print_version (void) { - luai_writestring(LUA_COPYRIGHT "\n", sizeof(LUA_COPYRIGHT) + 1); + luai_writestring(LUA_COPYRIGHT, sizeof(LUA_COPYRIGHT)); + luai_writeline(); } @@ -320,7 +321,7 @@ static void dotty (lua_State *L) { } } lua_settop(L, 0); /* clear stack */ - luai_writestring("\n", 1); + luai_writeline(); progname = oldprogname; } -- cgit v1.2.3-55-g6feb