From e8a7ecb982effdfc1148098b288c6ac7130f756e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 25 May 2005 10:21:26 -0300 Subject: luaL_findstring -> luaL_checkoption --- lbaselib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lbaselib.c') diff --git a/lbaselib.c b/lbaselib.c index 1fea255f..0eee03dd 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.176 2005/05/17 19:49:15 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.177 2005/05/20 15:53:42 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -192,9 +192,8 @@ static int luaB_collectgarbage (lua_State *L) { "count", "step", "setpause", "setstepmul", NULL}; static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; - int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts); + int o = luaL_checkoption(L, 1, "collect", opts); int ex = luaL_optinteger(L, 2, 0); - luaL_argcheck(L, o >= 0, 1, "invalid option"); lua_pushinteger(L, lua_gc(L, optsnum[o], ex)); return 1; } -- cgit v1.2.3-55-g6feb