diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-05-26 13:09:40 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-05-26 13:09:40 -0300 |
| commit | ee7d0c26493e1303a06f45b28ee2822c5a6aff05 (patch) | |
| tree | 86781476f7f308055fc6340440fad855d2ae8601 /lua.c | |
| parent | aa13c591f59f55ea31c14fcc554f8fc96dff67c2 (diff) | |
| download | lua-ee7d0c26493e1303a06f45b28ee2822c5a6aff05.tar.gz lua-ee7d0c26493e1303a06f45b28ee2822c5a6aff05.tar.bz2 lua-ee7d0c26493e1303a06f45b28ee2822c5a6aff05.zip | |
new macro 'luai_writeline' to print newlines (and flush 'stdout')
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.c,v 1.197 2011/03/14 15:39:42 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.198 2011/05/03 16:01:57 roberto Exp roberto $ |
| 3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -183,7 +183,8 @@ static int docall (lua_State *L, int narg, int nres) { | |||
| 183 | 183 | ||
| 184 | 184 | ||
| 185 | static void print_version (void) { | 185 | static void print_version (void) { |
| 186 | luai_writestring(LUA_COPYRIGHT "\n", sizeof(LUA_COPYRIGHT) + 1); | 186 | luai_writestring(LUA_COPYRIGHT, sizeof(LUA_COPYRIGHT)); |
| 187 | luai_writeline(); | ||
| 187 | } | 188 | } |
| 188 | 189 | ||
| 189 | 190 | ||
| @@ -320,7 +321,7 @@ static void dotty (lua_State *L) { | |||
| 320 | } | 321 | } |
| 321 | } | 322 | } |
| 322 | lua_settop(L, 0); /* clear stack */ | 323 | lua_settop(L, 0); /* clear stack */ |
| 323 | luai_writestring("\n", 1); | 324 | luai_writeline(); |
| 324 | progname = oldprogname; | 325 | progname = oldprogname; |
| 325 | } | 326 | } |
| 326 | 327 | ||
