# HG changeset patch # User Olaf Hering <[email protected]> # Date 1306149753 -7200 # Branch HEAD # Node ID 0d1d529d6205a2144f5c1495fb2e008a942495b2 # Parent 160e52d652e0d5161afd1ae4c067b1094b4f82e5 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 <[email protected]> diff -r 160e52d652e0 -r 0d1d529d6205 browser.c --- a/browser.c Mon May 23 13:22:33 2011 +0200 +++ b/browser.c Mon May 23 13:22:33 2011 +0200 @@ -428,8 +428,10 @@ static int examine_directory (MUTTMENU * 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;
