1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

Fixed bug with /alias and /unalias commands when alias begins with '/'

This commit is contained in:
Sebastien Helleu
2006-03-30 17:08:23 +00:00
parent 8c8a4104f0
commit cc324abb75
2 changed files with 22 additions and 2 deletions
+11 -1
View File
@@ -341,8 +341,10 @@ alias_new (char *alias_name, char *alias_command)
{
t_weechat_alias *new_alias, *ptr_alias;
if (alias_name[0] == '/')
while (alias_name[0] == '/')
{
alias_name++;
}
if (ascii_strcasecmp (alias_name, "builtin") == 0)
return NULL;
@@ -1105,6 +1107,11 @@ weechat_cmd_alias (t_irc_server *server, t_irc_channel *channel,
if (arguments && arguments[0])
{
while (arguments[0] == '/')
{
arguments++;
}
/* Define new alias */
pos = strchr (arguments, ' ');
if (pos)
@@ -3525,6 +3532,9 @@ weechat_cmd_unalias (t_irc_server *server, t_irc_channel *channel,
(void) server;
(void) channel;
if (arguments[0] == '/')
arguments++;
ptr_weelist = weelist_search (index_commands, arguments);
if (!ptr_weelist)
{
+11 -1
View File
@@ -341,8 +341,10 @@ alias_new (char *alias_name, char *alias_command)
{
t_weechat_alias *new_alias, *ptr_alias;
if (alias_name[0] == '/')
while (alias_name[0] == '/')
{
alias_name++;
}
if (ascii_strcasecmp (alias_name, "builtin") == 0)
return NULL;
@@ -1105,6 +1107,11 @@ weechat_cmd_alias (t_irc_server *server, t_irc_channel *channel,
if (arguments && arguments[0])
{
while (arguments[0] == '/')
{
arguments++;
}
/* Define new alias */
pos = strchr (arguments, ' ');
if (pos)
@@ -3525,6 +3532,9 @@ weechat_cmd_unalias (t_irc_server *server, t_irc_channel *channel,
(void) server;
(void) channel;
if (arguments[0] == '/')
arguments++;
ptr_weelist = weelist_search (index_commands, arguments);
if (!ptr_weelist)
{