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:
+11
-1
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user