diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-10-21 19:10:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-10-21 19:10:37 +0200 |
commit | 0ff08e54f5f0715c2e4c27a8c987d844be1a462e (patch) | |
tree | 9c3e2fbaadcadfd7e2a5be9bd7f05149ca100563 /src/plugins | |
parent | 30e48336f46ff68598e9007445dbfa9f5dd00865 (diff) | |
download | weechat-0ff08e54f5f0715c2e4c27a8c987d844be1a462e.zip |
trigger: add variable "tg_argc" in data set by command trigger (closes #1576)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/trigger/trigger-callback.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index c2625265d..195f16899 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -1042,7 +1042,7 @@ trigger_callback_command_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - char str_name[32]; + char str_name[32], str_temp[128]; int i; TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK); @@ -1053,6 +1053,8 @@ trigger_callback_command_cb (const void *pointer, void *data, /* add data in hashtables used for conditions/replace/command */ trigger_callback_set_common_vars (trigger, extra_vars); weechat_hashtable_set (pointers, "buffer", buffer); + snprintf (str_temp, sizeof (str_temp), "%d", argc); + weechat_hashtable_set (extra_vars, "tg_argc", str_temp); for (i = 0; i < argc; i++) { snprintf (str_name, sizeof (str_name), "tg_argv%d", i); |