diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-23 16:20:38 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-23 16:20:38 -0200 |
| commit | 9a41506b8f26e387493880e0affc2e23d604a97e (patch) | |
| tree | 26a2ea2247c33e099647dd59cb11d8db6e429ed8 | |
| parent | 9a6d9ea57a41c046b135281ee574e7d877d359c9 (diff) | |
| download | lua-9a41506b8f26e387493880e0affc2e23d604a97e.tar.gz lua-9a41506b8f26e387493880e0affc2e23d604a97e.tar.bz2 lua-9a41506b8f26e387493880e0affc2e23d604a97e.zip | |
'os.exit' should close state only when second argument is true
| -rw-r--r-- | loslib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loslib.c,v 1.24 2008/06/13 16:59:00 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.25 2009/08/25 19:58:08 roberto Exp roberto $ |
| 3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -239,7 +239,7 @@ static int os_setlocale (lua_State *L) { | |||
| 239 | 239 | ||
| 240 | static int os_exit (lua_State *L) { | 240 | static int os_exit (lua_State *L) { |
| 241 | int status = luaL_optint(L, 1, EXIT_SUCCESS); | 241 | int status = luaL_optint(L, 1, EXIT_SUCCESS); |
| 242 | if (!lua_toboolean(L, 2)) | 242 | if (lua_toboolean(L, 2)) |
| 243 | lua_close(L); | 243 | lua_close(L); |
| 244 | exit(status); | 244 | exit(status); |
| 245 | } | 245 | } |
