no need to work on a file if its empty. speeds things up a hell of a lot.

SVN revision: 30803
This commit is contained in:
codewarrior 2007-07-13 23:23:13 +00:00 committed by codewarrior
parent 7643c66325
commit 61b09fd882
1 changed files with 9 additions and 2 deletions

View File

@ -531,6 +531,8 @@ efreet_mime_fallback_check(const char *file)
i = fread(buf, 1, sizeof(buf), f);
fclose(f);
if (i == 0)
return "application/octet-stream";
/*
* Check for ASCII control characters in the first 32 bytes.
* New lines and carriage returns are ignored as they are
@ -992,8 +994,13 @@ efreet_mime_magic_check_priority(const char *file,
fclose(f);
return NULL;
}
bytes_read = fread(buf, 1, sizeof(buf), f);
if ((bytes_read = fread(buf, 1, sizeof(buf), f)) == 0)
{
fclose(f);
return NULL;
}
while ((m = ecore_list_next(magics)))
{
if ((start != 0) && (m->priority > start))