diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-01-15 10:02:43 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-01-15 10:04:43 +0100 |
commit | 619f09f2d6fe267cebeb56ef652afda830031dce (patch) | |
tree | a788867b441f92e5a0fabd3bc90d032c6e9ec442 /src | |
parent | e6f65122a9e6c6ee3f4c4a5bf359283474bf99a3 (diff) | |
download | weechat-619f09f2d6fe267cebeb56ef652afda830031dce.zip |
xfer: fix auto-accept of server/nick when the server name contains UTF-8 chars (issue #1739)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/xfer/xfer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index 447dbc92c..2b59ccafe 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -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; |