mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
'os.exit' should close state only when second argument is true
This commit is contained in:
parent
9a6d9ea57a
commit
9a41506b8f
4
loslib.c
4
loslib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: loslib.c,v 1.24 2008/06/13 16:59:00 roberto Exp roberto $
|
** $Id: loslib.c,v 1.25 2009/08/25 19:58:08 roberto Exp roberto $
|
||||||
** Standard Operating System library
|
** Standard Operating System library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -239,7 +239,7 @@ static int os_setlocale (lua_State *L) {
|
|||||||
|
|
||||||
static int os_exit (lua_State *L) {
|
static int os_exit (lua_State *L) {
|
||||||
int status = luaL_optint(L, 1, EXIT_SUCCESS);
|
int status = luaL_optint(L, 1, EXIT_SUCCESS);
|
||||||
if (!lua_toboolean(L, 2))
|
if (lua_toboolean(L, 2))
|
||||||
lua_close(L);
|
lua_close(L);
|
||||||
exit(status);
|
exit(status);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user