aboutsummaryrefslogtreecommitdiff
path: root/loadlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-06 11:59:12 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-11-06 11:59:12 -0200
commit6d8d282e0f6fc74f2499a9ab3971613115fdf0f9 (patch)
treefac78387ac6a8a7e80418be2cd76936e00153ee5 /loadlib.c
parent00c8a17a2da8fbeaf5b5542c0b7a0c4dd4fdfc91 (diff)
downloadlua-6d8d282e0f6fc74f2499a9ab3971613115fdf0f9.tar.gz
lua-6d8d282e0f6fc74f2499a9ab3971613115fdf0f9.tar.bz2
lua-6d8d282e0f6fc74f2499a9ab3971613115fdf0f9.zip
avoid calling "extra value" as if it were a function option
Diffstat (limited to 'loadlib.c')
-rw-r--r--loadlib.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/loadlib.c b/loadlib.c
index eb9c9a49..352869c3 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.99 2011/06/28 17:13:28 roberto Exp roberto $ 2** $Id: loadlib.c,v 1.100 2011/07/05 12:49:35 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**
@@ -516,9 +516,11 @@ static void set_env (lua_State *L) {
516static void dooptions (lua_State *L, int n) { 516static void dooptions (lua_State *L, int n) {
517 int i; 517 int i;
518 for (i = 2; i <= n; i++) { 518 for (i = 2; i <= n; i++) {
519 lua_pushvalue(L, i); /* get option (a function) */ 519 if (lua_isfunction(L, i)) { /* avoid 'calling' extra info. */
520 lua_pushvalue(L, -2); /* module */ 520 lua_pushvalue(L, i); /* get option (a function) */
521 lua_call(L, 1, 0); 521 lua_pushvalue(L, -2); /* module */
522 lua_call(L, 1, 0);
523 }
522 } 524 }
523} 525}
524 526