Use special case for indexing empty files

This commit is contained in:
Jean-Francois Dockes
2015-04-16 19:49:40 +02:00
parent e825286037
commit d10b557e4c
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -133,6 +133,9 @@ string mimetype(const string &fn, const struct stat *stp,
return "inode/symlink";
if (!S_ISREG(stp->st_mode))
return "inode/x-fsspecial";
// Empty files are just this: avoid further errors with actual filters.
if (stp->st_size == 0)
return "inode/x-empty";
}
string mtype;