diff options
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -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 | ||
| 129 | static int dolibrary (lua_State *L, const char *name) { | 129 | static 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 | } |
