From f719c70dfdfac97ae0c9f2e04e854d0520a590a8 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 12 Dec 2013 20:12:28 +0100 Subject: [PATCH] Fix search bug. If mid-string match was found, the last match would be returned. --- file_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file_list.c b/file_list.c index 9a62c881f0..dd5725b837 100644 --- a/file_list.c +++ b/file_list.c @@ -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;