From 8700e0bb36e0d52b25975d4486bf3e923cabdf68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 20 Feb 2022 16:29:31 +0100 Subject: scripts: auto-load scripts with supported extensions only (closes #1698) --- src/plugins/tcl/weechat-tcl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/tcl') diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c index 86433dd26..22163f948 100644 --- a/src/plugins/tcl/weechat-tcl.c +++ b/src/plugins/tcl/weechat-tcl.c @@ -423,10 +423,14 @@ weechat_tcl_load (const char *filename, const char *code) void weechat_tcl_load_cb (void *data, const char *filename) { + const char *pos_dot; + /* make C compiler happy */ (void) data; - weechat_tcl_load (filename, NULL); + pos_dot = strrchr (filename, '.'); + if (pos_dot && (strcmp (pos_dot, ".tcl") == 0)) + weechat_tcl_load (filename, NULL); } /* -- cgit v1.2.3