mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
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:
commit
bb8625f7fe
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user