mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
trigger: fix search of triggers with UTF-8 chars in name (issue #1739)
This commit is contained in:
@@ -31,6 +31,7 @@ Bug fixes::
|
||||
* irc: fix parsing of message 338 (whois, host) sent by Rizon server (issue #1737)
|
||||
* irc: fix display of message 344 received as whois geo info (issue #1736)
|
||||
* irc: fix display of IRC numeric messages with no parameters
|
||||
* trigger: fix search of triggers with UTF-8 chars in name (issue #1739)
|
||||
|
||||
Tests::
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ trigger_search_with_option (struct t_config_option *option)
|
||||
const char *ptr_name;
|
||||
char *pos_option;
|
||||
struct t_trigger *ptr_trigger;
|
||||
int num_chars;
|
||||
|
||||
if (!option)
|
||||
return NULL;
|
||||
@@ -220,10 +221,12 @@ trigger_search_with_option (struct t_config_option *option)
|
||||
if (!pos_option)
|
||||
return NULL;
|
||||
|
||||
num_chars = weechat_utf8_pos (ptr_name, pos_option - ptr_name);
|
||||
|
||||
for (ptr_trigger = triggers; ptr_trigger;
|
||||
ptr_trigger = ptr_trigger->next_trigger)
|
||||
{
|
||||
if (weechat_strncasecmp (ptr_trigger->name, ptr_name, pos_option - ptr_name) == 0)
|
||||
if (weechat_strncasecmp (ptr_trigger->name, ptr_name, num_chars) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user