Fix search bug.

If mid-string match was found, the last match would be returned.
This commit is contained in:
Themaister 2013-12-12 20:12:28 +01:00
parent 1a8d009b20
commit f719c70dfd

View File

@ -138,7 +138,7 @@ bool file_list_search(const file_list_t *list, const char *needle, size_t *index
ret = true;
break;
}
else if (str) // Found mid-string match, but try to find a match with first chars before we settle.
else if (str && !ret) // Found mid-string match, but try to find a match with first chars before we settle.
{
*index = i;
ret = true;