diff options
Diffstat (limited to 'loadlib.c')
-rw-r--r-- | loadlib.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loadlib.c,v 1.59 2007/12/12 14:36:12 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.60 2008/08/05 19:25:42 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 | ** |
@@ -524,8 +524,7 @@ static void setfenv (lua_State *L) { | |||
524 | if (lua_getstack(L, 1, &ar) == 0 || | 524 | if (lua_getstack(L, 1, &ar) == 0 || |
525 | lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ | 525 | lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ |
526 | lua_iscfunction(L, -1)) | 526 | lua_iscfunction(L, -1)) |
527 | luaL_error(L, "function " LUA_QL("module") | 527 | luaL_error(L, LUA_QL("module") " not called from a Lua function"); |
528 | " not called from a Lua function"); | ||
529 | lua_pushvalue(L, -2); /* copy new environment table to top */ | 528 | lua_pushvalue(L, -2); /* copy new environment table to top */ |
530 | lua_setfenv(L, -2); | 529 | lua_setfenv(L, -2); |
531 | lua_pop(L, 1); /* remove function */ | 530 | lua_pop(L, 1); /* remove function */ |