allow for loading of eo.lua files from module path

This commit is contained in:
Daniel Kolesa 2014-11-19 14:05:18 +00:00
parent 541662833c
commit e2351f0086
1 changed files with 2 additions and 1 deletions

View File

@ -126,7 +126,7 @@ elua_register_require(lua_State *L)
Eina_Bool noenv = lua_toboolean (L, lua_upvalueindex(5));
Arg_Data *data = NULL;
char corepathbuf[PATH_MAX], modpathbuf[PATH_MAX], appspathbuf[PATH_MAX];
int n = 2;
int n = 3;
lua_pushvalue(L, 1);
elua_require_ref = luaL_ref(L, LUA_REGISTRYINDEX);
lua_pushvalue(L, 2);
@ -174,6 +174,7 @@ elua_register_require(lua_State *L)
lua_pushfstring(L, "%s/?.lua;", data->value);
++n;
}
lua_pushfstring(L, "%s/?.eo.lua;", modpath);
lua_pushfstring(L, "%s/?.lua;", modpath);
lua_pushvalue(L, 3);
lua_concat(L, n + 1);