summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-14 12:20:28 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-28 15:13:47 +0100
commit1de735b7791f9bfd5f0f9f52bd809130558b74b0 (patch)
treeec14beffd3372323d9dd62980222270a55bdcc34 /src
parentdb177de20431f2c2dc98d267d586196f67a85915 (diff)
downloadweechat-1de735b7791f9bfd5f0f9f52bd809130558b74b0.zip
alias: make aliases case sensitive, convert default aliases to lower case (issue #1872)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/alias/alias-command.c2
-rw-r--r--src/plugins/alias/alias-config.c64
-rw-r--r--src/plugins/alias/alias-info.c2
-rw-r--r--src/plugins/alias/alias.c4
4 files changed, 36 insertions, 36 deletions
diff --git a/src/plugins/alias/alias-command.c b/src/plugins/alias/alias-command.c
index 7a539c7ae..d9a704317 100644
--- a/src/plugins/alias/alias-command.c
+++ b/src/plugins/alias/alias-command.c
@@ -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)
{
diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c
index 99d95b64b..8a03a6061 100644
--- a/src/plugins/alias/alias-config.c
+++ b/src/plugins/alias/alias-config.c
@@ -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 },
};
diff --git a/src/plugins/alias/alias-info.c b/src/plugins/alias/alias-info.c
index b64449ac7..12c81e481 100644
--- a/src/plugins/alias/alias-info.c
+++ b/src/plugins/alias/alias-info.c
@@ -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))
{
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c
index fea7da3c8..587feaeac 100644
--- a/src/plugins/alias/alias.c
+++ b/src/plugins/alias/alias.c
@@ -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;
}