Skip to content

Commit

Permalink
Fix incorrect server browser filter highlighting
Browse files Browse the repository at this point in the history
By calculating the correct length of the string matched in the haystack using the added `end` parameter of `str_utf8_find_nocase`.
  • Loading branch information
Robyt3 committed Jul 14, 2023
1 parent 909209d commit 5b51ec9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/game/client/components/menus_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,10 @@ bool CMenus::PrintHighlighted(const char *pName, F &&PrintFn)
}
else
{
pFilteredStr = str_utf8_find_nocase(pName, aFilterStr);
const char *pFilteredStrEnd;
pFilteredStr = str_utf8_find_nocase(pName, aFilterStr, &pFilteredStrEnd);
if(pFilteredStr != nullptr && pFilteredStrEnd != nullptr)
FilterLen = pFilteredStrEnd - pFilteredStr;
}
if(pFilteredStr)
{
Expand Down

0 comments on commit 5b51ec9

Please sign in to comment.