diff options
| -rw-r--r-- | loadlib.c | 4 |
1 files changed, 1 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loadlib.c,v 1.88 2010/07/25 15:03:37 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.89 2010/07/28 15:51:59 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 | ** |
| @@ -428,8 +428,6 @@ static int loader_Croot (lua_State *L) { | |||
| 428 | static int loader_preload (lua_State *L) { | 428 | static int loader_preload (lua_State *L) { |
| 429 | const char *name = luaL_checkstring(L, 1); | 429 | const char *name = luaL_checkstring(L, 1); |
| 430 | lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); | 430 | lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); |
| 431 | if (!lua_istable(L, -1)) | ||
| 432 | luaL_error(L, LUA_QL("package.preload") " must be a table"); | ||
| 433 | lua_getfield(L, -1, name); | 431 | lua_getfield(L, -1, name); |
| 434 | if (lua_isnil(L, -1)) /* not found? */ | 432 | if (lua_isnil(L, -1)) /* not found? */ |
| 435 | lua_pushfstring(L, "\n\tno field package.preload['%s']", name); | 433 | lua_pushfstring(L, "\n\tno field package.preload['%s']", name); |
