Skip to content
Snippets Groups Projects
Commit 9e12fa0a authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix #38: "Broken require in lua"

parent bb79c139
No related branches found
No related tags found
No related merge requests found
...@@ -1296,9 +1296,14 @@ tarantool_lua_init() ...@@ -1296,9 +1296,14 @@ tarantool_lua_init()
* packages, Tarantool-specific Lua libs and * packages, Tarantool-specific Lua libs and
* instance-specific Lua scripts. * instance-specific Lua scripts.
*/ */
tarantool_lua_setpath(L, "path", cfg.script_dir, LUA_LIBPATH,
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s/?.lua", cfg.script_dir);
tarantool_lua_setpath(L, "path", path, LUA_LIBPATH,
LUA_SYSPATH, NULL); LUA_SYSPATH, NULL);
tarantool_lua_setpath(L, "cpath", LUA_LIBCPATH, snprintf(path, sizeof(path), "%s/?.so", cfg.script_dir);
tarantool_lua_setpath(L, "cpath", path, LUA_LIBCPATH,
LUA_SYSCPATH, NULL); LUA_SYSCPATH, NULL);
/* Loadi 'ffi' extension and make it inaccessible */ /* Loadi 'ffi' extension and make it inaccessible */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment