summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-01-15 09:59:34 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-01-15 10:04:12 +0100
commite6f65122a9e6c6ee3f4c4a5bf359283474bf99a3 (patch)
treecb181a19ef767c582458bc68ef67f60234681b12
parent50167ca96f20bf60d6b12f9dfe12e22a1ce561d2 (diff)
downloadweechat-e6f65122a9e6c6ee3f4c4a5bf359283474bf99a3.zip
spell: fix comparison of URL prefix with UTF-8 chars (issue #1739)
There is no problem in practice because the possible URL prefixes are hardcoded in the spell plugin and don't contain any UTF-8 char on more than one byte.
-rw-r--r--src/plugins/spell/spell.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/spell/spell.c b/src/plugins/spell/spell.c
index 8244d003e..b664aa8ed 100644
--- a/src/plugins/spell/spell.c
+++ b/src/plugins/spell/spell.c
@@ -379,8 +379,10 @@ spell_string_is_url (const char *word)
for (i = 0; spell_url_prefix[i]; i++)
{
if (weechat_strncasecmp (word, spell_url_prefix[i],
- strlen (spell_url_prefix[i])) == 0)
+ weechat_utf8_strlen (spell_url_prefix[i])) == 0)
+ {
return 1;
+ }
}
/* word is not an URL */