diff options
| -rw-r--r-- | loadlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loadlib.c,v 1.76 2010/01/11 17:11:24 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.77 2010/01/11 17:34:59 roberto Exp roberto $ |
| 3 | ** Dynamic library loader for Lua | 3 | ** Dynamic library loader for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | ** | 5 | ** |
| @@ -397,6 +397,7 @@ static const char *pushnexttemplate (lua_State *L, const char *path) { | |||
| 397 | 397 | ||
| 398 | static const char *searchpath (lua_State *L, const char *name, | 398 | static const char *searchpath (lua_State *L, const char *name, |
| 399 | const char *path) { | 399 | const char *path) { |
| 400 | name = luaL_gsub(L, name, ".", LUA_DIRSEP); | ||
| 400 | lua_pushliteral(L, ""); /* error accumulator */ | 401 | lua_pushliteral(L, ""); /* error accumulator */ |
| 401 | while ((path = pushnexttemplate(L, path)) != NULL) { | 402 | while ((path = pushnexttemplate(L, path)) != NULL) { |
| 402 | const char *filename = luaL_gsub(L, lua_tostring(L, -1), | 403 | const char *filename = luaL_gsub(L, lua_tostring(L, -1), |
| @@ -426,7 +427,6 @@ static int ll_searchpath (lua_State *L) { | |||
| 426 | static const char *findfile (lua_State *L, const char *name, | 427 | static const char *findfile (lua_State *L, const char *name, |
| 427 | const char *pname) { | 428 | const char *pname) { |
| 428 | const char *path; | 429 | const char *path; |
| 429 | name = luaL_gsub(L, name, ".", LUA_DIRSEP); | ||
| 430 | lua_getfield(L, LUA_ENVIRONINDEX, pname); | 430 | lua_getfield(L, LUA_ENVIRONINDEX, pname); |
| 431 | path = lua_tostring(L, -1); | 431 | path = lua_tostring(L, -1); |
| 432 | if (path == NULL) | 432 | if (path == NULL) |
