]> granicus.if.org Git - mutt/commitdiff
examine_directory: set directory/symlink size to zero
authorOlaf Hering <olaf@aepfle.de>
Tue, 3 Dec 2013 15:42:39 +0000 (16:42 +0100)
committerKevin McCarthy <kevin@8t8.us>
Fri, 12 Jan 2018 22:35:27 +0000 (14:35 -0800)
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 <olaf@aepfle.de>
browser.c

index d39f9e181966e7daba10c6ade07049d530f8dcd7..5d4d256e21ef8f4bc930191682a862553a750500 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -451,8 +451,10 @@ static int examine_directory (MUTTMENU *menu, struct browser_state *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;