]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/engine: prefer local import path first
authorMarek Vavrusa <marek@vavrusa.com>
Wed, 8 Jun 2016 07:05:00 +0000 (00:05 -0700)
committerMarek Vavrusa <marek@vavrusa.com>
Wed, 6 Jul 2016 06:33:38 +0000 (23:33 -0700)
daemon/engine.c

index 7f1529f562971e859c71fdfd0a881615d7b37be2..f9c6d4489ccbda6d080b3aeb0295f6761c981c56 100644 (file)
@@ -571,7 +571,7 @@ int engine_cmd(struct engine *engine, const char *str)
 static int engine_loadconf(struct engine *engine, const char *config_path)
 {
        /* 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, "");
        if (ret != 0) {
                lua_pop(engine->L, 1);
@@ -770,6 +770,6 @@ struct engine *engine_luaget(lua_State *L)
 {
        lua_getglobal(L, "__engine");
        struct engine *engine = lua_touserdata(L, -1);
-       lua_pop(engine->L, 1);
+       lua_pop(L, 1);
        return engine;
 }