aboutsummaryrefslogtreecommitdiff
path: root/loadlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-08-02 14:14:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-08-02 14:14:48 -0300
commitfd4b4a2a68992259ffd91299f68b41de4759d8f0 (patch)
tree318f2c54993e7b94c83c7f1bda80b7786d0d8ed7 /loadlib.c
parentd447945685986f0b1a7bd5d7ed7746bf4ebd5914 (diff)
downloadlua-fd4b4a2a68992259ffd91299f68b41de4759d8f0.tar.gz
lua-fd4b4a2a68992259ffd91299f68b41de4759d8f0.tar.bz2
lua-fd4b4a2a68992259ffd91299f68b41de4759d8f0.zip
detail: registry._PRELOAD must be a table, no need to check
Diffstat (limited to 'loadlib.c')
-rw-r--r--loadlib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/loadlib.c b/loadlib.c
index d655480a..d46f4acd 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -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) {
428static int loader_preload (lua_State *L) { 428static 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);