1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

alias: make aliases case sensitive, convert default aliases to lower case (issue #1872)

This commit is contained in:
Sébastien Helleu
2023-01-14 12:20:28 +01:00
parent db177de204
commit 1de735b779
4 changed files with 36 additions and 36 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ alias_command_cb (const void *pointer, void *data,
ptr_alias = ptr_alias->next_alias)
{
if (!ptr_alias_name
|| weechat_strcasestr (ptr_alias->name, ptr_alias_name))
|| strstr (ptr_alias->name, ptr_alias_name))
{
if (!alias_found)
{
+32 -32
View File
@@ -33,39 +33,39 @@ struct t_config_section *alias_config_section_cmd = NULL;
struct t_config_section *alias_config_section_completion = NULL;
char *alias_default[][3] =
{ { "AAWAY", "allserv /away", NULL },
{ "ANICK", "allserv /nick", NULL },
{ "BEEP", "print -beep", NULL },
{ "BYE", "quit", NULL },
{ "C", "buffer clear", NULL },
{ "CL", "buffer clear", NULL },
{ "CLOSE", "buffer close", NULL },
{ "CHAT", "dcc chat", NULL },
{ "EXIT", "quit", NULL },
{ "IG", "ignore", NULL },
{ "J", "join", NULL },
{ "K", "kick", NULL },
{ "KB", "kickban", NULL },
{ "LEAVE", "part", NULL },
{ "M", "msg", NULL },
{ "MUB", "unban *", NULL },
{ "MSGBUF", "command -buffer $1 * /input send $2-",
{ { "aaway", "allserv /away", NULL },
{ "anick", "allserv /nick", NULL },
{ "beep", "print -beep", NULL },
{ "bye", "quit", NULL },
{ "c", "buffer clear", NULL },
{ "cl", "buffer clear", NULL },
{ "close", "buffer close", NULL },
{ "chat", "dcc chat", NULL },
{ "exit", "quit", NULL },
{ "ig", "ignore", NULL },
{ "j", "join", NULL },
{ "k", "kick", NULL },
{ "kb", "kickban", NULL },
{ "leave", "part", NULL },
{ "m", "msg", NULL },
{ "mub", "unban *", NULL },
{ "msgbuf", "command -buffer $1 * /input send $2-",
"%(buffers_plugins_names)" },
{ "N", "names", NULL },
{ "Q", "query", NULL },
{ "REDRAW", "window refresh", NULL },
{ "SAY", "msg *", NULL },
{ "SIGNOFF", "quit", NULL },
{ "T", "topic", NULL },
{ "UB", "unban", NULL },
{ "UMODE", "mode $nick", NULL },
{ "V", "command core version", NULL },
{ "W", "who", NULL },
{ "WC", "window close", NULL },
{ "WI", "whois", NULL },
{ "WII", "whois $1 $1", NULL },
{ "WM", "window merge", NULL },
{ "WW", "whowas", NULL },
{ "n", "names", NULL },
{ "q", "query", NULL },
{ "redraw", "window refresh", NULL },
{ "say", "msg *", NULL },
{ "signoff", "quit", NULL },
{ "t", "topic", NULL },
{ "ub", "unban", NULL },
{ "umode", "mode $nick", NULL },
{ "v", "command core version", NULL },
{ "w", "who", NULL },
{ "wc", "window close", NULL },
{ "wi", "whois", NULL },
{ "wii", "whois $1 $1", NULL },
{ "wm", "window merge", NULL },
{ "ww", "whowas", NULL },
{ NULL, NULL, NULL },
};
+1 -1
View File
@@ -68,7 +68,7 @@ alias_info_infolist_alias_cb (const void *pointer, void *data,
ptr_alias = ptr_alias->next_alias)
{
if (!arguments || !arguments[0]
|| weechat_string_match (ptr_alias->name, arguments, 0))
|| weechat_string_match (ptr_alias->name, arguments, 1))
{
if (!alias_add_to_infolist (ptr_infolist, ptr_alias))
{
+2 -2
View File
@@ -87,7 +87,7 @@ alias_search (const char *alias_name)
for (ptr_alias = alias_list; ptr_alias;
ptr_alias = ptr_alias->next_alias)
{
if (weechat_strcasecmp (alias_name, ptr_alias->name) == 0)
if (strcmp (alias_name, ptr_alias->name) == 0)
return ptr_alias;
}
return NULL;
@@ -504,7 +504,7 @@ alias_find_pos (const char *name)
for (ptr_alias = alias_list; ptr_alias; ptr_alias = ptr_alias->next_alias)
{
if (weechat_strcasecmp (name, ptr_alias->name) < 0)
if (strcmp (name, ptr_alias->name) < 0)
return ptr_alias;
}