diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-11 15:55:25 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-01-11 15:55:25 -0200 |
commit | e4b4623abcf0c33cea793701c4a8691c190e0c62 (patch) | |
tree | 893646e51ecfa33d0a0a8f95dd9572d0b833b354 /loadlib.c | |
parent | cef96b73e1820e0f0d65f1616284ec40502e5e44 (diff) | |
download | lua-e4b4623abcf0c33cea793701c4a8691c190e0c62.tar.gz lua-e4b4623abcf0c33cea793701c4a8691c190e0c62.tar.bz2 lua-e4b4623abcf0c33cea793701c4a8691c190e0c62.zip |
'searchpath' changes dots into directory separators
Diffstat (limited to 'loadlib.c')
-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) |