Browse Source

Fix regression in calculating apparent du for dirs

master
Arun Prakash Jana 4 years ago
parent
commit
0cb5ddf3f1
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 10 additions and 10 deletions
  1. +10
    -10
      src/nnn.c

+ 10
- 10
src/nnn.c View File

@@ -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;


Loading…
Cancel
Save