* On 23 May 2011, Olaf Hering wrote: 
> # HG changeset patch
> # User Olaf Hering <o...@aepfle.de>
> # 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.

I would say that seeing the size of the linked-to file is useful --
isn't the reason that people use symlinks for mail so make one folder
look like another?  Not sure that giving a zero value for symlinks is
more useful (where the target is a regular file).

> Signed-off-by: Olaf Hering <o...@aepfle.de>
> 
> 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;

-- 
David Champion • d...@uchicago.edu • IT Services • University of Chicago

Reply via email to