diff options
| -rw-r--r-- | loadlib.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -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) { | |||
| 516 | static void dooptions (lua_State *L, int n) { | 516 | static 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 | ||
