From: Olaf Hering Date: Tue, 3 Dec 2013 15:42:39 +0000 (+0100) Subject: examine_directory: set directory/symlink size to zero X-Git-Tag: neomutt-20180223~45^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=469afa220d2b6cc508a563a7e230e024ca6d0b1f;p=neomutt examine_directory: set directory/symlink size to zero The size of a directory or symlink in the folder browser is not meaningful. For directories it means just how many blocks were allocated to hold all entries. It does not mean that the entries are still present in the directory. For symlinks its the size of the target. Set both to zero to simplify the folder browser output. Signed-off-by: Olaf Hering --- diff --git a/browser.c b/browser.c index b932798e4..847d52d37 100644 --- a/browser.c +++ b/browser.c @@ -800,7 +800,10 @@ static int examine_directory(struct Menu *menu, struct BrowserState *state, if (lstat(buffer, &s) == -1) continue; - if ((!S_ISREG(s.st_mode)) && (!S_ISDIR(s.st_mode)) && (!S_ISLNK(s.st_mode))) + /* No size for directories or symlinks */ + if (S_ISDIR(s.st_mode) || S_ISLNK(s.st_mode)) + s.st_size = 0; + else if (!S_ISREG(s.st_mode)) continue; tmp = Incoming;