From d0f829fec2feb4c7af6101b9576428d2128f3b5c Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 16 Apr 2015 19:49:40 +0200 Subject: [PATCH] Use special case for indexing empty files --- src/index/mimetype.cpp | 3 +++ src/sampleconf/mimeconf | 1 + 2 files changed, 4 insertions(+) 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