From 1a94193147337b4c540febe258b777b635d34bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 23 Jan 2016 10:37:07 +0100 Subject: relay: fix command "input" received from clients (weechat protocol) (closes #663) The command "input" received with only spaces in content of message was ignored by WeeChat (because of the split on spaces). --- ChangeLog.asciidoc | 2 ++ src/plugins/relay/weechat/relay-weechat-protocol.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index fc03b7073..51f4d5356 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -31,6 +31,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] keep_eol is 2 and the string ends with separators * irc: add missing completion "*" for target in command /msg * irc: fix /msg command with multiple targets including "*" +* relay: fix command "input" received from clients with only spaces in + content of message (weechat protocol) (issue #663) [[1.4]] == Version 1.4 (2016-01-10) diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c index ce47b358d..f216cb56f 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.c +++ b/src/plugins/relay/weechat/relay-weechat-protocol.c @@ -405,7 +405,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input) struct t_gui_buffer *ptr_buffer; char *pos, **timer_args; - RELAY_WEECHAT_PROTOCOL_MIN_ARGS(2); + RELAY_WEECHAT_PROTOCOL_MIN_ARGS(1); ptr_buffer = relay_weechat_protocol_get_buffer (argv[0]); if (!ptr_buffer) @@ -417,7 +417,7 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(input) "\"%s %s\""), RELAY_PLUGIN_NAME, command, - argv_eol[0]); + argv[0]); } return WEECHAT_RC_OK; } @@ -1351,7 +1351,7 @@ relay_weechat_protocol_recv (struct t_relay_client *client, const char *data) pos++; } argv = weechat_string_split (pos, " ", 0, 0, &argc); - argv_eol = weechat_string_split (pos, " ", 1, 0, NULL); + argv_eol = weechat_string_split (pos, " ", 2, 0, NULL); } for (i = 0; protocol_cb[i].name; i++) -- cgit v1.2.3