aboutsummaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-07-01 11:26:28 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-07-01 11:26:28 -0300
commit80ec81926c19ff638a65088bb3d5a55d20b55945 (patch)
tree6630fe28b6b20f83fd69ad64bc71fa4bc546b491 /lua.c
parent96917ff42a7867e72629d6cd39c818df4c250b91 (diff)
downloadlua-80ec81926c19ff638a65088bb3d5a55d20b55945.tar.gz
lua-80ec81926c19ff638a65088bb3d5a55d20b55945.tar.bz2
lua-80ec81926c19ff638a65088bb3d5a55d20b55945.zip
`lua.c' also needs the default path, so auxlib should provide it
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/lua.c b/lua.c
index d57db025..dac53e29 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.127 2004/06/16 20:22:43 roberto Exp roberto $ 2** $Id: lua.c,v 1.128 2004/06/17 14:06:52 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,15 +143,9 @@ 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_getglobal(L, "require"); 146 name = luaL_searchpath(L, name, NULL);
147 if (!lua_isfunction(L, -1)) { /* no `require' defined? */ 147 if (name == NULL) return report(1);
148 lua_pop(L, 1); 148 else return file_input(name);
149 return file_input(name);
150 }
151 else {
152 lua_pushstring(L, name);
153 return report(lcall(1, 1));
154 }
155} 149}
156 150
157 151