mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 00:03:12 +02:00
core: send command line parameter to plugins only if the name starts with the plugin name followed by a colon
This commit is contained in:
@@ -273,12 +273,14 @@ plugin_get_args (struct t_weechat_plugin *plugin,
|
||||
int argc, char **argv,
|
||||
int *plugin_argc, char ***plugin_argv)
|
||||
{
|
||||
int i, temp_argc;
|
||||
int i, temp_argc, length_plugin_name;
|
||||
char **temp_argv;
|
||||
|
||||
temp_argc = 0;
|
||||
temp_argv = NULL;
|
||||
|
||||
length_plugin_name = strlen (plugin->name);
|
||||
|
||||
if (argc > 0)
|
||||
{
|
||||
temp_argv = malloc ((argc + 1) * sizeof (*temp_argv));
|
||||
@@ -290,8 +292,9 @@ plugin_get_args (struct t_weechat_plugin *plugin,
|
||||
|| (strcmp (argv[i], "--no-connect") == 0)
|
||||
|| (strcmp (argv[i], "-s") == 0)
|
||||
|| (strcmp (argv[i], "--no-script") == 0)
|
||||
|| (strncmp (argv[i], plugin->name,
|
||||
strlen (plugin->name)) == 0))
|
||||
|| ((strncmp (argv[i], plugin->name,
|
||||
length_plugin_name) == 0)
|
||||
&& (argv[i][length_plugin_name] == ':')))
|
||||
{
|
||||
temp_argv[temp_argc++] = argv[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user