Merge pull request #1442 from npwoods/fix_typeahead_lookup

Fixed an off by one error when identifying best entries for typeahead on the file selection and software list dialogs
This commit is contained in:
Vas Crabb 2016-09-24 23:06:01 +10:00 committed by GitHub
commit bb8625f7fe
2 changed files with 2 additions and 2 deletions

View File

@ -446,7 +446,7 @@ void menu_file_selector::handle()
if (cur_selected != &entry)
{
int match = 0;
for (int i = 0; i < m_filename.size(); i++)
for (int i = 0; i < m_filename.size() + 1; i++)
{
if (core_strnicmp(entry.basename.c_str(), m_filename.c_str(), i) == 0)
match = i;

View File

@ -280,7 +280,7 @@ void menu_software_list::handle()
auto &compare_name = m_ordered_by_shortname ? entry.short_name : entry.long_name;
int match = 0;
for (int i = 0; i < m_filename_buffer.length(); i++)
for (int i = 0; i < m_filename_buffer.size() + 1; i++)
{
if (core_strnicmp(compare_name.c_str(), m_filename_buffer.c_str(), i) == 0)
match = i;