1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

scripts: auto-load scripts with supported extensions only (closes #1698)

This commit is contained in:
Sébastien Helleu
2022-02-20 16:29:31 +01:00
parent 601bd7e0b8
commit 8700e0bb36
9 changed files with 41 additions and 8 deletions
+1
View File
@@ -40,6 +40,7 @@ Bug fixes::
* irc: fix display of message 344 received as whois geo info (issue #1736)
* irc: fix display of IRC numeric messages with no parameters
* python: fix crash in hook callbacks after script loading failure (issue #1740)
* scripts: auto-load scripts with supported extensions only (issue #1698)
* trigger: fix search of triggers with UTF-8 chars in name (issue #1739)
* xfer: fix auto-accept of server/nick when the server name contains UTF-8 chars (issue #1739)
+5 -1
View File
@@ -598,10 +598,14 @@ weechat_guile_load (const char *filename, const char *code)
void
weechat_guile_load_cb (void *data, const char *filename)
{
const char *pos_dot;
/* make C compiler happy */
(void) data;
weechat_guile_load (filename, NULL);
pos_dot = strrchr (filename, '.');
if (pos_dot && (strcmp (pos_dot, ".scm") == 0))
weechat_guile_load (filename, NULL);
}
/*
+5 -1
View File
@@ -417,10 +417,14 @@ weechat_js_load (const char *filename, const char *code)
void
weechat_js_load_cb (void *data, const char *filename)
{
const char *pos_dot;
/* make C++ compiler happy */
(void) data;
weechat_js_load (filename, NULL);
pos_dot = strrchr (filename, '.');
if (pos_dot && (strcmp (pos_dot, ".js") == 0))
weechat_js_load (filename, NULL);
}
/*
+5 -1
View File
@@ -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);
}
/*
+5 -1
View File
@@ -663,10 +663,14 @@ weechat_perl_load (const char *filename, const char *code)
void
weechat_perl_load_cb (void *data, const char *filename)
{
const char *pos_dot;
/* make C compiler happy */
(void) data;
weechat_perl_load (filename, NULL);
pos_dot = strrchr (filename, '.');
if (pos_dot && (strcmp (pos_dot, ".pl") == 0))
weechat_perl_load (filename, NULL);
}
/*
+5 -1
View File
@@ -743,10 +743,14 @@ weechat_php_load (const char *filename, const char *code)
void
weechat_php_load_cb (void *data, const char *filename)
{
const char *pos_dot;
/* make C compiler happy */
(void) data;
weechat_php_load (filename, NULL);
pos_dot = strrchr (filename, '.');
if (pos_dot && (strcmp (pos_dot, ".php") == 0))
weechat_php_load (filename, NULL);
}
/*
+5 -1
View File
@@ -1053,10 +1053,14 @@ weechat_python_load (const char *filename, const char *code)
void
weechat_python_load_cb (void *data, const char *filename)
{
const char *pos_dot;
/* make C compiler happy */
(void) data;
weechat_python_load (filename, NULL);
pos_dot = strrchr (filename, '.');
if (pos_dot && (strcmp (pos_dot, ".py") == 0))
weechat_python_load (filename, NULL);
}
/*
+5 -1
View File
@@ -734,10 +734,14 @@ weechat_ruby_load (const char *filename, const char *code)
void
weechat_ruby_load_cb (void *data, const char *filename)
{
const char *pos_dot;
/* make C compiler happy */
(void) data;
weechat_ruby_load (filename, NULL);
pos_dot = strrchr (filename, '.');
if (pos_dot && (strcmp (pos_dot, ".rb") == 0))
weechat_ruby_load (filename, NULL);
}
/*
+5 -1
View File
@@ -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);
}
/*