void
fifo_exec (const char *text)
{
- char *text2, *pos_msg;
+ char *text2, *pos_msg, *command_unescaped;
+ int escaped;
struct t_gui_buffer *ptr_buffer;
text2 = strdup (text);
return;
pos_msg = NULL;
+ command_unescaped = NULL;
+ escaped = 0;
ptr_buffer = NULL;
/*
* look for plugin + buffer name at beginning of text
* text may be: "plugin.buffer *text" or "*text"
*/
- if (text2[0] == '*')
+ if (text2[0] == '*' || text2[0] == '\\')
{
+ escaped = text2[0] == '\\';
pos_msg = text2 + 1;
ptr_buffer = weechat_current_buffer ();
}
else
{
pos_msg = strstr (text2, " *");
+ if (!pos_msg)
+ pos_msg = strstr (text2, " \\");
+
if (!pos_msg)
{
weechat_printf (NULL,
free (text2);
return;
}
+
+ escaped = pos_msg[1] == '\\';
pos_msg[0] = '\0';
pos_msg += 2;
ptr_buffer = weechat_buffer_search ("==", text2);
}
}
+ if (escaped)
+ {
+ command_unescaped = weechat_string_convert_escaped_chars (pos_msg);
+ if (command_unescaped)
+ pos_msg = command_unescaped;
+ }
+
weechat_command (ptr_buffer, pos_msg);
free (text2);
+ if (command_unescaped)
+ free(command_unescaped);
}
/*