summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-11-06 13:13:45 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-11-06 13:13:45 +0100
commitc4590b78392027bcd2f3ddafe86dace5f05c4340 (patch)
tree77af551f1f9eee47c057193c790485a88d80eb62 /src
parent3c1c398cd43962414a96c19604573d8487def548 (diff)
downloadweechat-c4590b78392027bcd2f3ddafe86dace5f05c4340.zip
Fix buffer search in fifo plugin: name is now plugin.buffer (like irc.freenode.#weechat)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/fifo/fifo.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c
index b439a2d73..ff9e9a3b3 100644
--- a/src/plugins/fifo/fifo.c
+++ b/src/plugins/fifo/fifo.c
@@ -170,7 +170,7 @@ fifo_remove ()
void
fifo_exec (const char *text)
{
- char *text2, *pos_msg, *pos;
+ char *text2, *pos_msg, *pos_buffer, *pos;
struct t_gui_buffer *ptr_buffer;
text2 = strdup (text);
@@ -180,8 +180,8 @@ fifo_exec (const char *text)
pos = NULL;
ptr_buffer = NULL;
- /* look for buffer name at beginning of text
- text may be: "name *text" or "name *text" or "*text" */
+ /* look for plugin + buffer name at beginning of text
+ text may be: "plugin.buffer *text" or "*text" */
if (text2[0] == '*')
{
pos_msg = text2 + 1;
@@ -201,12 +201,20 @@ fifo_exec (const char *text)
pos_msg[0] = '\0';
pos_msg += 2;
- if (text2[0])
+ pos_buffer = strchr (text2, '.');
+ if (!pos_buffer)
{
- ptr_buffer = weechat_buffer_search (NULL, text2);
- if (!ptr_buffer)
- ptr_buffer = weechat_current_buffer;
+ weechat_printf (NULL,
+ _("%s%s: error, invalid text received on pipe"),
+ weechat_prefix ("error"), FIFO_PLUGIN_NAME);
+ free (text2);
+ return;
}
+ pos_buffer[0] = '\0';
+ pos_buffer++;
+
+ if (text2[0] && pos_buffer[0])
+ ptr_buffer = weechat_buffer_search (text2, pos_buffer);
}
if (!ptr_buffer)