Use special case for indexing empty files

This commit is contained in:
Jean-Francois Dockes 2015-04-16 19:49:40 +02:00
parent 822171bd7e
commit d0f829fec2
2 changed files with 4 additions and 0 deletions

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;

View file

@ -133,6 +133,7 @@ image/vnd.djvu = exec rcldjvu
image/svg+xml = exec rclsvg
image/x-xcf = execm rclimg
inode/symlink = internal
inode/x-empty = exec rclnull
message/rfc822 = internal
text/calendar = execm rclics;mimetype=text/plain
text/html = internal