diff options
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.125 2004/04/30 20:13:38 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.126 2004/05/31 18:51:50 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -143,8 +143,7 @@ static int dostring (const char *s, const char *name) { | |||
143 | 143 | ||
144 | 144 | ||
145 | static int load_file (const char *name) { | 145 | static int load_file (const char *name) { |
146 | lua_pushliteral(L, "require"); | 146 | lua_getglobal(L, "require"); |
147 | lua_rawget(L, LUA_GLOBALSINDEX); | ||
148 | if (!lua_isfunction(L, -1)) { /* no `require' defined? */ | 147 | if (!lua_isfunction(L, -1)) { /* no `require' defined? */ |
149 | lua_pop(L, 1); | 148 | lua_pop(L, 1); |
150 | return file_input(name); | 149 | return file_input(name); |