X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=tools%2Fcpkg2c.mll;h=835519987821e3f4999c193a2c47724359e4bc5d;hp=b33cf84c0db16f4ca8297ceba4f08f4f0087594a;hb=4606bdeeaf175b61f3c54dcbadc330f2505d9f67;hpb=597020b9829312a50c15784916f473da9e75efd0 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; } ")