aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-14 20:59:37 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-14 20:59:37 +0530
commite0cdbcb521dca6b68ed36145de01029a4a784b07 (patch)
tree5522929cde554bcd442993fb4635b3c25e8fd790
parent1029ff0d5b538370554eff6f1592f84bcf21835a (diff)
downloadnnn-e0cdbcb521dca6b68ed36145de01029a4a784b07.tar.gz
Check for file first (more in number)
-rw-r--r--src/nnn.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 022403f..8220c5d 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4271,8 +4271,9 @@ static void launch_app(const char *path, char *newpath)
static int sum_bsize(const char *UNUSED(fpath), const struct stat *sb, int typeflag, struct FTW *UNUSED(ftwbuf))
{
- if (sb->st_blocks && (typeflag == FTW_D
- || (typeflag == FTW_F && (sb->st_nlink <= 1 || test_set_bit((uint)sb->st_ino)))))
+ if (sb->st_blocks
+ && ((typeflag == FTW_F && (sb->st_nlink <= 1 || test_set_bit((uint)sb->st_ino)))
+ || typeflag == FTW_D))
ent_blocks += sb->st_blocks;
++num_files;
@@ -4281,8 +4282,9 @@ 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_F && (sb->st_nlink <= 1 || test_set_bit((uint)sb->st_ino)))))
+ if (sb->st_size
+ && ((typeflag == FTW_F && (sb->st_nlink <= 1 || test_set_bit((uint)sb->st_ino)))
+ || typeflag == FTW_D))
ent_blocks += sb->st_size;
++num_files;