diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/trigger/trigger.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index e78417421..b81404c9b 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -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:: diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c index 4e88a2978..5f99dbcc0 100644 --- a/src/plugins/trigger/trigger.c +++ b/src/plugins/trigger/trigger.c @@ -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; } |