commit e4b4623abcf0c33cea793701c4a8691c190e0c62
parent cef96b73e1820e0f0d65f1616284ec40502e5e44
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 11 Jan 2010 15:55:01 -0200
'searchpath' changes dots into directory separators
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/loadlib.c b/loadlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.76 2010/01/11 17:11:24 roberto Exp roberto $
+** $Id: loadlib.c,v 1.77 2010/01/11 17:34:59 roberto Exp roberto $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
@@ -397,6 +397,7 @@ static const char *pushnexttemplate (lua_State *L, const char *path) {
static const char *searchpath (lua_State *L, const char *name,
const char *path) {
+ name = luaL_gsub(L, name, ".", LUA_DIRSEP);
lua_pushliteral(L, ""); /* error accumulator */
while ((path = pushnexttemplate(L, path)) != NULL) {
const char *filename = luaL_gsub(L, lua_tostring(L, -1),
@@ -426,7 +427,6 @@ static int ll_searchpath (lua_State *L) {
static const char *findfile (lua_State *L, const char *name,
const char *pname) {
const char *path;
- name = luaL_gsub(L, name, ".", LUA_DIRSEP);
lua_getfield(L, LUA_ENVIRONINDEX, pname);
path = lua_tostring(L, -1);
if (path == NULL)