1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

api: fix function strcmp_ignore_chars with case sensitive comparison and wide chars starting with the same byte

This commit is contained in:
Sébastien Helleu
2022-12-23 23:20:29 +01:00
parent 91149f0acc
commit 5fc656a1b8
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -36,6 +36,7 @@ Bug fixes::
* core: fix context info in buffers with free content (issue #1832)
* core: keep terminal title unchanged when option weechat.look.window_title is set to empty value (issue #1835, issue #1836)
* core: fix crash when setting invalid color in option with null value (issue #1844)
* api: fix function strcmp_ignore_chars with case sensitive comparison and wide chars starting with the same byte
* api: send NULL values to config section callbacks in scripting API (issue #1843)
* api: fix function string_cut when there are non printable chars in suffix
* api: do not expect any return value in callbacks "callback_change" and "callback_delete" of function config_new_option (scripting API)
+1 -1
View File
@@ -583,7 +583,7 @@ string_strcmp_ignore_chars (const char *string1, const char *string2,
/* look at diff */
diff = (case_sensitive) ?
(int)string1[0] - (int)string2[0] : utf8_charcasecmp (string1, string2);
utf8_charcmp (string1, string2) : utf8_charcasecmp (string1, string2);
if (diff != 0)
return (diff < 0) ? -1 : 1;
+3
View File
@@ -566,6 +566,9 @@ TEST(CoreString, Comparison)
LONGS_EQUAL(1, string_strcmp_ignore_chars (".abc..abc", "..", ".", 0));
LONGS_EQUAL(-1, string_strcmp_ignore_chars (".", "..abcabc", ".", 0));
LONGS_EQUAL(0, string_strcmp_ignore_chars (".", ".", ".", 0));
LONGS_EQUAL(-1, string_strcmp_ignore_chars ("è", "é", "", 0));
LONGS_EQUAL(-1, string_strcmp_ignore_chars ("è", "É", "", 0));
LONGS_EQUAL(-1, string_strcmp_ignore_chars ("è", "é", "", 1));
}
/*