aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-08 16:35:55 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-08 16:35:55 +0000
commita5b808650c78dea42009435e612cddf8cbcd95ef (patch)
treec137dceaca447e09a4084ea6ba5427dfc3fb8a5a /src/lua/lua_common.c
parentaeb018c0587c453c7a5c40259699eb34613d1d5d (diff)
downloadrspamd-a5b808650c78dea42009435e612cddf8cbcd95ef.tar.gz
rspamd-a5b808650c78dea42009435e612cddf8cbcd95ef.zip
[Minor] Fix lua path on OSX
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index f77fe6b6e..b44931682 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -215,6 +215,12 @@ lua_add_actions_global (lua_State *L)
lua_setglobal (L, "rspamd_actions");
}
+#ifndef __APPLE__
+#define OS_SO_SUFFIX ".so"
+#else
+#define OS_SO_SUFFIX ".dylib"
+#endif
+
void
rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars)
{
@@ -335,10 +341,12 @@ rspamd_lua_set_path (lua_State *L, const ucl_object_t *cfg_obj, GHashTable *vars
lua_getfield (L, -1, "cpath");
old_path = luaL_checkstring (L, -1);
+
rspamd_snprintf (path_buf, sizeof (path_buf),
- "%s/?.so;"
+ "%s/?%s;"
"%s",
libdir,
+ OS_SO_SUFFIX,
old_path);
lua_pop (L, 1);
lua_pushstring (L, path_buf);