From 9a41506b8f26e387493880e0affc2e23d604a97e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 23 Nov 2009 16:20:38 -0200 Subject: 'os.exit' should close state only when second argument is true --- loslib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'loslib.c') diff --git a/loslib.c b/loslib.c index 6286dd75..7ab3c4e9 100644 --- a/loslib.c +++ b/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 ** See Copyright Notice in lua.h */ @@ -239,7 +239,7 @@ static int os_setlocale (lua_State *L) { static int os_exit (lua_State *L) { int status = luaL_optint(L, 1, EXIT_SUCCESS); - if (!lua_toboolean(L, 2)) + if (lua_toboolean(L, 2)) lua_close(L); exit(status); } -- cgit v1.2.3-55-g6feb