1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

api: fix infinite loop in function string_replace when the search string is empty

This commit is contained in:
Sébastien Helleu
2026-06-03 21:15:16 +02:00
parent 377b6da43d
commit d15ce789a0
3 changed files with 6 additions and 0 deletions
+2
View File
@@ -1454,6 +1454,8 @@ TEST(CoreString, Replace)
WEE_TEST_STR(NULL, string_replace ("string", NULL, "replace"));
WEE_TEST_STR(NULL, string_replace (NULL, "search", "replace"));
WEE_TEST_STR("test abc def", string_replace("test abc def", "", "xxx"));
WEE_TEST_STR("test abc def", string_replace("test abc def", "xyz", "xxx"));
WEE_TEST_STR("test xxx def", string_replace("test abc def", "abc", "xxx"));
WEE_TEST_STR("xxx test xxx def xxx",