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

core: fix recursive search of group in nicklist

This commit is contained in:
Sébastien Helleu
2024-04-28 13:07:08 +02:00
parent 4a058ae0f5
commit dcd872bc45
2 changed files with 18 additions and 17 deletions
+1
View File
@@ -49,6 +49,7 @@ New features::
Bug fixes::
* core: fix recursive search of group in nicklist
* core: use nick offline highlight color for prefix of action message when the nick is offline with a highlight
* core: add missing hdata name "buffer" in hdata "hotlist"
* core: fix reset to initial scroll position after search of text in buffer (issue #2093)
+17 -17
View File
@@ -193,7 +193,7 @@ gui_nicklist_search_group_internal (struct t_gui_buffer *buffer,
const char *name,
int skip_digits)
{
struct t_gui_nick_group *ptr_group;
struct t_gui_nick_group *ptr_group, *ptr_group_found;
const char *ptr_name;
if (!buffer || !name)
@@ -205,24 +205,24 @@ gui_nicklist_search_group_internal (struct t_gui_buffer *buffer,
if (!from_group)
return NULL;
ptr_name = (skip_digits) ?
gui_nicklist_get_group_start (from_group->name) : from_group->name;
if (strcmp (ptr_name, name) == 0)
return from_group;
if (from_group->children)
{
ptr_group = gui_nicklist_search_group_internal (buffer,
from_group->children,
name,
skip_digits);
if (ptr_group)
return ptr_group;
}
ptr_group = from_group;
while (ptr_group)
{
ptr_name = (skip_digits) ?
gui_nicklist_get_group_start (ptr_group->name) : ptr_group->name;
if (strcmp (ptr_name, name) == 0)
return ptr_group;
ptr_group = ptr_group->next_group;
for (ptr_group = from_group->children; ptr_group;
ptr_group = ptr_group->next_group)
{
ptr_group_found = gui_nicklist_search_group_internal (
buffer,
ptr_group,
name,
skip_digits);
if (ptr_group_found)
return ptr_group_found;
}
}
/* group not found */