aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 1fea255f..0eee03dd 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.176 2005/05/17 19:49:15 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.177 2005/05/20 15:53:42 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -192,9 +192,8 @@ static int luaB_collectgarbage (lua_State *L) {
192 "count", "step", "setpause", "setstepmul", NULL}; 192 "count", "step", "setpause", "setstepmul", NULL};
193 static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, 193 static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,
194 LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; 194 LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL};
195 int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts); 195 int o = luaL_checkoption(L, 1, "collect", opts);
196 int ex = luaL_optinteger(L, 2, 0); 196 int ex = luaL_optinteger(L, 2, 0);
197 luaL_argcheck(L, o >= 0, 1, "invalid option");
198 lua_pushinteger(L, lua_gc(L, optsnum[o], ex)); 197 lua_pushinteger(L, lua_gc(L, optsnum[o], ex));
199 return 1; 198 return 1;
200} 199}