aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-05 20:58:08 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-05 21:05:37 +0530
commit0cb5ddf3f189089d24f0df3ac1c7174023662044 (patch)
tree74b673858ba89648c0c6678a61b3e1d029a6c4ae
parent1fbaa6105262d6b7449e426b01d7c4474d243318 (diff)
downloadnnn-0cb5ddf3f189089d24f0df3ac1c7174023662044.tar.gz
Fix regression in calculating apparent du for dirs
-rw-r--r--src/nnn.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 59df132..bf22926 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4237,7 +4237,7 @@ static int sum_bsize(const char *UNUSED(fpath), const struct stat *sb, int typef
static int sum_asize(const char *UNUSED(fpath), const struct stat *sb, int typeflag, struct FTW *UNUSED(ftwbuf))
{
if (sb->st_size && (typeflag == FTW_D
- || (typeflag == FTW_D && (sb->st_nlink <= 1 || test_set_bit((uint)sb->st_ino)))))
+ || (typeflag == FTW_F && (sb->st_nlink <= 1 || test_set_bit((uint)sb->st_ino)))))
ent_blocks += sb->st_size;
++num_files;
@@ -4660,15 +4660,6 @@ static bool set_sort_flags(void)
entrycmpfn = &entrycmp;
switch (r) {
- case 'c':
- cfg.mtimeorder = 0;
- cfg.sizeorder = 0;
- cfg.apparentsz = 0;
- cfg.blkorder = 0;
- cfg.extnorder = 0;
- entrycmpfn = &entrycmp;
- namecmpfn = &xstricmp;
- break;
case 'a': /* Apparent du */
cfg.apparentsz ^= 1;
if (cfg.apparentsz) {
@@ -4697,6 +4688,15 @@ static bool set_sort_flags(void)
clearfilter(); /* Reload directory */
endselection(); /* We are going to reload dir */
break;
+ case 'c':
+ cfg.mtimeorder = 0;
+ cfg.sizeorder = 0;
+ cfg.apparentsz = 0;
+ cfg.blkorder = 0;
+ cfg.extnorder = 0;
+ entrycmpfn = &entrycmp;
+ namecmpfn = &xstricmp;
+ break;
case 'e': /* File extension */
cfg.extnorder ^= 1;
cfg.sizeorder = 0;