From 38d35e3314082ffae54e496a7aa00036a0ba853a Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Thu, 30 Aug 2018 22:57:33 +0100 Subject: [PATCH] Fix false positives in search-in-project --- src/bin/edi_searchpanel.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bin/edi_searchpanel.c b/src/bin/edi_searchpanel.c index 8f9a596..0654052 100644 --- a/src/bin/edi_searchpanel.c +++ b/src/bin/edi_searchpanel.c @@ -204,14 +204,13 @@ edi_search_term(const char *start, const char *end, int boundary, lookup = memchr(search, *term, cchunk); // Did we found the right word or not ? - if (lookup && !memcmp(lookup, term, eina_stringshare_strlen(term))) - break ; - if (!lookup) - break ; + break; + else if (!memcmp(lookup, term, eina_stringshare_strlen(term))) + break; // We didn't, start looking from where we are at - cchunk -= lookup + 1 - search; + cchunk -= lookup - search; search = lookup + 1; } while (cchunk > 0);