aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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