Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix inf. loop in OnJumpLetter() after 9e16ec

  • Loading branch information...
commit 58d3e4d7b70f7d9f74aa3209775609af07fbc7e3 1 parent 2680e87
@t-nelson t-nelson authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 xbmc/guilib/GUIBaseContainer.cpp
View
8 xbmc/guilib/GUIBaseContainer.cpp
@@ -532,8 +532,9 @@ void CGUIBaseContainer::OnJumpLetter(char letter)
return;
// find the current letter we're focused on
- unsigned int offset = CorrectOffset(GetOffset(), GetCursor()) - 1;
- for (unsigned int i = (offset + 1) % m_items.size(); i != offset; i = (i+1) % m_items.size())
+ unsigned int offset = CorrectOffset(GetOffset(), GetCursor());
+ unsigned int i = offset;
+ do
{
CGUIListItemPtr item = m_items[i];
if (0 == strnicmp(SortUtils::RemoveArticles(item->GetLabel()).c_str(), m_match.c_str(), m_match.size()))
@@ -541,7 +542,8 @@ void CGUIBaseContainer::OnJumpLetter(char letter)
SelectItem(i);
return;
}
- }
+ i = (i+1) % m_items.size();
+ } while (i != offset);
// no match found - repeat with a single letter
if (m_match.size() > 1)
{

1 comment on commit 58d3e4d

@Memphiz
Owner

And here is your "first git commit without wtf" award :)

Please sign in to comment.
Something went wrong with that request. Please try again.