diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-02 15:24:50 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-02 15:24:50 +0200 |
commit | d58f8fa15ed9249e06d05329128fcd1138a01fc4 (patch) | |
tree | 36ad4284e269311f068414bfbea3c82d800cc1ac /src/plugins/alias | |
parent | 2019129701b043ecb6fa061a50cd1f84be929238 (diff) | |
download | weechat-d58f8fa15ed9249e06d05329128fcd1138a01fc4.zip |
Fix bug in alias: use current buffer to run commands (bug #22876)
Diffstat (limited to 'src/plugins/alias')
-rw-r--r-- | src/plugins/alias/alias.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index 6837f8b85..4c2d0e4c5 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -243,6 +243,7 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, int some_args_replaced, length1, length2; /* make C compiler happy */ + (void) buffer; (void) argc; (void) argv; @@ -276,7 +277,10 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, { some_args_replaced = 1; if (*ptr_cmd[0] == '/') - alias_run_command (buffer, args_replaced); + { + alias_run_command (weechat_current_buffer (), + args_replaced); + } else { alias_command = malloc (1 + strlen(args_replaced) + 1); @@ -284,7 +288,8 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, { strcpy (alias_command, "/"); strcat (alias_command, args_replaced); - alias_run_command (buffer, alias_command); + alias_run_command (weechat_current_buffer (), + alias_command); free (alias_command); } } @@ -311,14 +316,18 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, strcat (alias_command, " "); strcat (alias_command, argv_eol[1]); - alias_run_command (buffer, alias_command); + alias_run_command (weechat_current_buffer (), + alias_command); free (alias_command); } } else { if (*ptr_cmd[0] == '/') - alias_run_command (buffer, *ptr_cmd); + { + alias_run_command (weechat_current_buffer (), + *ptr_cmd); + } else { alias_command = malloc (1 + strlen (*ptr_cmd) + 1); @@ -326,7 +335,8 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv, { strcpy (alias_command, "/"); strcat (alias_command, *ptr_cmd); - alias_run_command (buffer, alias_command); + alias_run_command (weechat_current_buffer (), + alias_command); free (alias_command); } } |