aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-11-12 11:31:51 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-11-12 11:31:51 -0200
commit52c0f9575b4253a8f3064158529dcedec3c9bffe (patch)
treecf9755dcfc1691fec3f6266efffb83ffda52a2bd
parent4fde357130fe588e9eea3a2045f233d4bf242ad1 (diff)
downloadlua-52c0f9575b4253a8f3064158529dcedec3c9bffe.tar.gz
lua-52c0f9575b4253a8f3064158529dcedec3c9bffe.tar.bz2
lua-52c0f9575b4253a8f3064158529dcedec3c9bffe.zip
uses return value from lua_getfield
-rw-r--r--loadlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/loadlib.c b/loadlib.c
index 3fceaf94..4e1cdf80 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.121 2014/11/03 15:11:10 roberto Exp roberto $ 2** $Id: loadlib.c,v 1.122 2014/11/10 14:28:31 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**
@@ -518,8 +518,8 @@ static void findloader (lua_State *L, const char *name) {
518 int i; 518 int i;
519 luaL_Buffer msg; /* to build error message */ 519 luaL_Buffer msg; /* to build error message */
520 luaL_buffinit(L, &msg); 520 luaL_buffinit(L, &msg);
521 lua_getfield(L, lua_upvalueindex(1), "searchers"); /* will be at index 3 */ 521 /* push 'package.searchers' to index 3 in the stack */
522 if (!lua_istable(L, 3)) 522 if (lua_getfield(L, lua_upvalueindex(1), "searchers") != LUA_TTABLE)
523 luaL_error(L, "'package.searchers' must be a table"); 523 luaL_error(L, "'package.searchers' must be a table");
524 /* iterate over available searchers to find a loader */ 524 /* iterate over available searchers to find a loader */
525 for (i = 1; ; i++) { 525 for (i = 1; ; i++) {