diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-02-19 14:15:35 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-02-19 14:15:35 -0300 |
| commit | f36e3196585d0658f103954b6d3a188d1bdac9d7 (patch) | |
| tree | 76811fa9bb388543399f8c7a38ba41ce752e2c63 | |
| parent | 0cea28a7859a2a82740e9201102c5e29df787ac8 (diff) | |
| download | lua-f36e3196585d0658f103954b6d3a188d1bdac9d7.tar.gz lua-f36e3196585d0658f103954b6d3a188d1bdac9d7.tar.bz2 lua-f36e3196585d0658f103954b6d3a188d1bdac9d7.zip | |
'fputs' changed to 'luai_writestring' + use of 'lua_checkversion'
| -rw-r--r-- | lua.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.c,v 1.170 2008/06/26 19:47:51 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.171 2008/07/11 17:51:01 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 | */ |
| @@ -227,7 +227,7 @@ static void dotty (lua_State *L) { | |||
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| 229 | lua_settop(L, 0); /* clear stack */ | 229 | lua_settop(L, 0); /* clear stack */ |
| 230 | fputs("\n", stdout); | 230 | luai_writestring("\n", 1); |
| 231 | fflush(stdout); | 231 | fflush(stdout); |
| 232 | progname = oldprogname; | 232 | progname = oldprogname; |
| 233 | } | 233 | } |
| @@ -343,6 +343,7 @@ static int pmain (lua_State *L) { | |||
| 343 | lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ | 343 | lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ |
| 344 | luaL_openlibs(L); /* open libraries */ | 344 | luaL_openlibs(L); /* open libraries */ |
| 345 | lua_gc(L, LUA_GCRESTART, 0); | 345 | lua_gc(L, LUA_GCRESTART, 0); |
| 346 | lua_checkversion(L); | ||
| 346 | s->ok = (handle_luainit(L) == LUA_OK); | 347 | s->ok = (handle_luainit(L) == LUA_OK); |
| 347 | if (!s->ok) return 0; | 348 | if (!s->ok) return 0; |
| 348 | script = collectargs(argv, &has_i, &has_v, &has_e); | 349 | script = collectargs(argv, &has_i, &has_v, &has_e); |
