summaryrefslogtreecommitdiff
path: root/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua.c')
-rw-r--r--lua.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lua.c b/lua.c
index a8c289e5..88ad392e 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.130 2004/07/13 19:56:44 roberto Exp roberto $ 2** $Id: lua.c,v 1.131 2004/08/26 14:19:55 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*/
@@ -127,7 +127,12 @@ static int dostring (lua_State *L, const char *s, const char *name) {
127 127
128 128
129static int dolibrary (lua_State *L, const char *name) { 129static int dolibrary (lua_State *L, const char *name) {
130 name = luaL_searchpath(L, name, NULL); 130 lua_getfield(L, LUA_GLOBALSINDEX, "_PATH");
131 if (!lua_isstring(L, -1)) {
132 l_message(progname, "global _PATH must be a string");
133 return 1;
134 }
135 name = luaL_searchpath(L, name, lua_tostring(L, -1));
131 if (name == NULL) return report(L, 1); 136 if (name == NULL) return report(L, 1);
132 else return dofile(L, name); 137 else return dofile(L, name);
133} 138}