diff options
Diffstat (limited to 'src/plugins/scripts')
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua.c | 4 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl.c | 4 | ||||
-rw-r--r-- | src/plugins/scripts/python/weechat-python.c | 4 | ||||
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby.c | 4 | ||||
-rw-r--r-- | src/plugins/scripts/script.c | 17 | ||||
-rw-r--r-- | src/plugins/scripts/script.h | 3 | ||||
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl.c | 4 |
7 files changed, 23 insertions, 17 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c index d87ad2417..71a76b62e 100644 --- a/src/plugins/scripts/lua/weechat-lua.c +++ b/src/plugins/scripts/lua/weechat-lua.c @@ -473,7 +473,6 @@ weechat_lua_infolist_cb (void *data, const char *infolist_name, { /* make C compiler happy */ (void) data; - (void) arguments; if (!infolist_name || !infolist_name[0]) return NULL; @@ -481,7 +480,8 @@ weechat_lua_infolist_cb (void *data, const char *infolist_name, if (weechat_strcasecmp (infolist_name, "lua_script") == 0) { return script_infolist_list_scripts (weechat_lua_plugin, - lua_scripts, pointer); + lua_scripts, pointer, + arguments); } return NULL; diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index c49f445cd..ac968f930 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -619,7 +619,6 @@ weechat_perl_infolist_cb (void *data, const char *infolist_name, { /* make C compiler happy */ (void) data; - (void) arguments; if (!infolist_name || !infolist_name[0]) return NULL; @@ -627,7 +626,8 @@ weechat_perl_infolist_cb (void *data, const char *infolist_name, if (weechat_strcasecmp (infolist_name, "perl_script") == 0) { return script_infolist_list_scripts (weechat_perl_plugin, - perl_scripts, pointer); + perl_scripts, pointer, + arguments); } return NULL; diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index 4f9087897..67c7b9834 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -704,7 +704,6 @@ weechat_python_infolist_cb (void *data, const char *infolist_name, { /* make C compiler happy */ (void) data; - (void) arguments; if (!infolist_name || !infolist_name[0]) return NULL; @@ -712,7 +711,8 @@ weechat_python_infolist_cb (void *data, const char *infolist_name, if (weechat_strcasecmp (infolist_name, "python_script") == 0) { return script_infolist_list_scripts (weechat_python_plugin, - python_scripts, pointer); + python_scripts, pointer, + arguments); } return NULL; diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c index 144700497..f4b10c8ba 100644 --- a/src/plugins/scripts/ruby/weechat-ruby.c +++ b/src/plugins/scripts/ruby/weechat-ruby.c @@ -672,7 +672,6 @@ weechat_ruby_infolist_cb (void *data, const char *infolist_name, { /* make C compiler happy */ (void) data; - (void) arguments; if (!infolist_name || !infolist_name[0]) return NULL; @@ -680,7 +679,8 @@ weechat_ruby_infolist_cb (void *data, const char *infolist_name, if (weechat_strcasecmp (infolist_name, "ruby_script") == 0) { return script_infolist_list_scripts (weechat_ruby_plugin, - ruby_scripts, pointer); + ruby_scripts, pointer, + arguments); } return NULL; diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index 42de1e057..2ebb4862b 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -1161,7 +1161,8 @@ script_add_to_infolist (struct t_weechat_plugin *weechat_plugin, struct t_infolist * script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *scripts, - void *pointer) + void *pointer, + const char *arguments) { struct t_infolist *ptr_infolist; struct t_plugin_script *ptr_script; @@ -1185,15 +1186,19 @@ script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin, } else { - /* build list with all scripts */ + /* build list with all scripts matching arguments */ for (ptr_script = scripts; ptr_script; ptr_script = ptr_script->next_script) { - if (!script_add_to_infolist (weechat_plugin, - ptr_infolist, ptr_script)) + if (!arguments || !arguments[0] + || weechat_string_match (ptr_script->name, arguments, 0)) { - weechat_infolist_free (ptr_infolist); - return NULL; + if (!script_add_to_infolist (weechat_plugin, + ptr_infolist, ptr_script)) + { + weechat_infolist_free (ptr_infolist); + return NULL; + } } } return ptr_infolist; diff --git a/src/plugins/scripts/script.h b/src/plugins/scripts/script.h index 715b9cc48..1b0f094fd 100644 --- a/src/plugins/scripts/script.h +++ b/src/plugins/scripts/script.h @@ -137,7 +137,8 @@ extern int script_add_to_infolist (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *script); extern struct t_infolist *script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *scripts, - void *pointer); + void *pointer, + const char *arguments); extern void script_print_log (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *scripts); diff --git a/src/plugins/scripts/tcl/weechat-tcl.c b/src/plugins/scripts/tcl/weechat-tcl.c index 79a85cef1..3a77e418b 100644 --- a/src/plugins/scripts/tcl/weechat-tcl.c +++ b/src/plugins/scripts/tcl/weechat-tcl.c @@ -414,7 +414,6 @@ weechat_tcl_infolist_cb (void *data, const char *infolist_name, { /* make C compiler happy */ (void) data; - (void) arguments; if (!infolist_name || !infolist_name[0]) return NULL; @@ -422,7 +421,8 @@ weechat_tcl_infolist_cb (void *data, const char *infolist_name, if (weechat_strcasecmp (infolist_name, "tcl_script") == 0) { return script_infolist_list_scripts (weechat_tcl_plugin, - tcl_scripts, pointer); + tcl_scripts, pointer, + arguments); } return NULL; |