1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

xfer: fix auto-accept of server/nick when the server name contains UTF-8 chars (issue #1739)

This commit is contained in:
Sébastien Helleu
2022-01-15 10:02:43 +01:00
parent e6f65122a9
commit 619f09f2d6
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -560,7 +560,7 @@ xfer_alloc ()
int
xfer_nick_auto_accepted (const char *server, const char *nick)
{
int rc, num_nicks, i;
int rc, i, num_nicks, num_chars;
char **nicks, *pos;
rc = 0;
@@ -581,7 +581,8 @@ xfer_nick_auto_accepted (const char *server, const char *nick)
pos = strrchr (nicks[i], '.');
if (pos)
{
if ((weechat_strncasecmp (server, nicks[i], pos - nicks[i]) == 0)
num_chars = weechat_utf8_pos (nicks[i], pos - nicks[i]);
if ((weechat_strncasecmp (server, nicks[i], num_chars) == 0)
&& (weechat_strcasecmp (nick, pos + 1) == 0))
{
rc = 1;