diff options
-rw-r--r-- | loadlib.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loadlib.c,v 1.17 2005/02/18 12:40:02 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.18 2005/02/28 15:58:48 roberto Exp roberto $ |
3 | ** Dynamic library loader for Lua | 3 | ** Dynamic library loader for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | * | 5 | * |
@@ -434,7 +434,6 @@ static int ll_module (lua_State *L) { | |||
434 | 434 | ||
435 | 435 | ||
436 | static const luaL_reg ll_funcs[] = { | 436 | static const luaL_reg ll_funcs[] = { |
437 | {"loadlib", ll_loadlib}, | ||
438 | {"require", ll_require}, | 437 | {"require", ll_require}, |
439 | {"module", ll_module}, | 438 | {"module", ll_module}, |
440 | {NULL, NULL} | 439 | {NULL, NULL} |
@@ -485,6 +484,11 @@ LUALIB_API int luaopen_loadlib (lua_State *L) { | |||
485 | /* set field `preload' */ | 484 | /* set field `preload' */ |
486 | lua_newtable(L); | 485 | lua_newtable(L); |
487 | lua_setfield(L, -2, "preload"); | 486 | lua_setfield(L, -2, "preload"); |
487 | /* create `loadlib' function */ | ||
488 | lua_pushcfunction(L, ll_loadlib); | ||
489 | lua_pushvalue(L, -1); | ||
490 | lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); /* COMPATIBILITY ONLY!! */ | ||
491 | lua_setfield(L, -2, "loadlib"); | ||
488 | lua_pushvalue(L, LUA_GLOBALSINDEX); | 492 | lua_pushvalue(L, LUA_GLOBALSINDEX); |
489 | luaL_openlib(L, NULL, ll_funcs, 0); /* open lib into global table */ | 493 | luaL_openlib(L, NULL, ll_funcs, 0); /* open lib into global table */ |
490 | return 1; | 494 | return 1; |