searchpanel: ignore ELF files.

We can easily check for ELF files here, let's do this and
avoid a lot of unnecessary noise in the search panel.
This commit is contained in:
Alastair Poole 2018-08-31 16:25:54 +01:00
parent 38d35e3314
commit aeb01d7e0e
1 changed files with 7 additions and 0 deletions

View File

@ -300,6 +300,7 @@ edi_search_file(Eina_File *file, const char *term)
{
Eina_Iterator_Search *it;
size_t length;
const char elf_header[4] = {0x7f, 'E', 'L', 'F'};
if (!file || !term || strlen(term) == 0) return NULL;
@ -319,6 +320,12 @@ edi_search_file(Eina_File *file, const char *term)
return NULL;
}
if (length >= 4 && !memcmp(it->map, elf_header, sizeof(elf_header)))
{
free(it);
return NULL;
}
it->fp = eina_file_dup(it->fp);
it->current.start = it->map;
it->current.end = NULL;