From: Pierre Habouzit Date: Mon, 26 Mar 2007 22:30:51 +0000 (+0200) Subject: small oopsies in the cpgk2c generator. X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=4606bdeeaf175b61f3c54dcbadc330f2505d9f67 small oopsies in the cpgk2c generator. Signed-off-by: Pierre Habouzit --- diff --git a/tools/cpkg2c.mll b/tools/cpkg2c.mll index b33cf84..8355199 100644 --- a/tools/cpkg2c.mll +++ b/tools/cpkg2c.mll @@ -524,7 +524,7 @@ int luaopen_%s(lua_State *L) luaL_newmetatable(L, \"%s\"); mt = lua_gettop(L); - lua_pushliteral(L, \"%s\"); + lua_pushliteral(L, \"__index\"); lua_pushvalue(L, mt); /* upvalue 1 */ lua_pushvalue(L, methods); /* upvalue 2 */ lua_pushcclosure(L, &luaM_%s_index, 2); @@ -541,8 +541,8 @@ int luaopen_%s(lua_State *L) lua_setmetatable(L, methods); - lua_pop(L, 1); /* drop mt */ - return 1; /* return methods */ + lua_pop(L, 2); /* drop mt + methods */ + return 1; } ")