aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lua.c b/lua.c
index cabc5592..112a20cc 100644
--- a/lua.c
+++ b/lua.c
@@ -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
145static int load_file (const char *name) { 145static 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);