diff --git a/src/index/mimetype.cpp b/src/index/mimetype.cpp index d6735011..9d62fe7d 100644 --- a/src/index/mimetype.cpp +++ b/src/index/mimetype.cpp @@ -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; diff --git a/src/sampleconf/mimeconf b/src/sampleconf/mimeconf index beb23c0e..29695b72 100644 --- a/src/sampleconf/mimeconf +++ b/src/sampleconf/mimeconf @@ -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