Commit 7603d186 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

daemon/engine: prefer local import path first

parent cf2a18b0
...@@ -571,7 +571,7 @@ int engine_cmd(struct engine *engine, const char *str) ...@@ -571,7 +571,7 @@ int engine_cmd(struct engine *engine, const char *str)
static int engine_loadconf(struct engine *engine, const char *config_path) static int engine_loadconf(struct engine *engine, const char *config_path)
{ {
/* Use module path for including Lua scripts */ /* Use module path for including Lua scripts */
static const char l_paths[] = "package.path = package.path..';" MODULEDIR "/?.lua'"; static const char l_paths[] = "package.path = '" MODULEDIR "/?.lua;'..package.path";
int ret = l_dobytecode(engine->L, l_paths, sizeof(l_paths) - 1, ""); int ret = l_dobytecode(engine->L, l_paths, sizeof(l_paths) - 1, "");
if (ret != 0) { if (ret != 0) {
lua_pop(engine->L, 1); lua_pop(engine->L, 1);
...@@ -770,6 +770,6 @@ struct engine *engine_luaget(lua_State *L) ...@@ -770,6 +770,6 @@ struct engine *engine_luaget(lua_State *L)
{ {
lua_getglobal(L, "__engine"); lua_getglobal(L, "__engine");
struct engine *engine = lua_touserdata(L, -1); struct engine *engine = lua_touserdata(L, -1);
lua_pop(engine->L, 1); lua_pop(L, 1);
return engine; return engine;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment