summaryrefslogtreecommitdiff
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-02-20 16:29:31 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-02-20 16:29:31 +0100
commit8700e0bb36e0d52b25975d4486bf3e923cabdf68 (patch)
tree0e78e19b763328944ee27213ec968e148bc203ee /src/plugins/lua
parent601bd7e0b871e21f1909d8ece03dd00262da93a0 (diff)
downloadweechat-8700e0bb36e0d52b25975d4486bf3e923cabdf68.zip
scripts: auto-load scripts with supported extensions only (closes #1698)
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/weechat-lua.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c
index 1a66cf166..898e438c0 100644
--- a/src/plugins/lua/weechat-lua.c
+++ b/src/plugins/lua/weechat-lua.c
@@ -696,10 +696,14 @@ weechat_lua_load (const char *filename, const char *code)
void
weechat_lua_load_cb (void *data, const char *filename)
{
+ const char *pos_dot;
+
/* make C compiler happy */
(void) data;
- weechat_lua_load (filename, NULL);
+ pos_dot = strrchr (filename, '.');
+ if (pos_dot && (strcmp (pos_dot, ".lua") == 0))
+ weechat_lua_load (filename, NULL);
}
/*