mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Dynamic view update in disk usage mode
This commit is contained in:
parent
1017413474
commit
fdeba8a87e
16
src/nnn.c
16
src/nnn.c
|
@ -4954,22 +4954,18 @@ static bool handle_cmd(enum action sel, const char *current, char *newpath)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sum_bsize(const char *UNUSED(fpath), const struct stat *sb, int typeflag, struct FTW *UNUSED(ftwbuf))
|
static int sum_bsize(const char *UNUSED(fpath), const struct stat *sb, int UNUSED(typeflag), struct FTW *UNUSED(ftwbuf))
|
||||||
{
|
{
|
||||||
if (sb->st_blocks
|
if (sb->st_blocks && (sb->st_nlink <= 1 || test_set_bit((uint_t)sb->st_ino)))
|
||||||
&& ((typeflag == FTW_F && (sb->st_nlink <= 1 || test_set_bit((uint_t)sb->st_ino)))
|
|
||||||
|| typeflag == FTW_D))
|
|
||||||
ent_blocks += sb->st_blocks;
|
ent_blocks += sb->st_blocks;
|
||||||
|
|
||||||
++num_files;
|
++num_files;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sum_asize(const char *UNUSED(fpath), const struct stat *sb, int typeflag, struct FTW *UNUSED(ftwbuf))
|
static int sum_asize(const char *UNUSED(fpath), const struct stat *sb, int UNUSED(typeflag), struct FTW *UNUSED(ftwbuf))
|
||||||
{
|
{
|
||||||
if (sb->st_size
|
if (sb->st_size && (sb->st_nlink <= 1 || test_set_bit((uint_t)sb->st_ino)))
|
||||||
&& ((typeflag == FTW_F && (sb->st_nlink <= 1 || test_set_bit((uint_t)sb->st_ino)))
|
|
||||||
|| typeflag == FTW_D))
|
|
||||||
ent_blocks += sb->st_size;
|
ent_blocks += sb->st_size;
|
||||||
|
|
||||||
++num_files;
|
++num_files;
|
||||||
|
@ -5100,6 +5096,8 @@ static int dentfill(char *path, struct entry **ppdents)
|
||||||
|
|
||||||
if (g_state.interrupt)
|
if (g_state.interrupt)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
ndents = n;
|
||||||
|
redraw(path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Do not recount hard links */
|
/* Do not recount hard links */
|
||||||
|
@ -5232,6 +5230,8 @@ static int dentfill(char *path, struct entry **ppdents)
|
||||||
|
|
||||||
if (g_state.interrupt)
|
if (g_state.interrupt)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
ndents = n;
|
||||||
|
redraw(path);
|
||||||
} else {
|
} else {
|
||||||
dentp->blocks = (cfg.apparentsz ? sb.st_size : sb.st_blocks);
|
dentp->blocks = (cfg.apparentsz ? sb.st_size : sb.st_blocks);
|
||||||
/* Do not recount hard links */
|
/* Do not recount hard links */
|
||||||
|
|
Loading…
Reference in a new issue