diff options
| author | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-09-04 16:05:53 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-09-04 16:05:53 +0200 |
| commit | 244fe311199e1df4230b111a7624ddd54c117428 (patch) | |
| tree | a3a4b7641cf565700a29ed28ad514797280f2471 /common | |
| parent | 5c30be15f86ae77b6f392a4029aec9f392b107f5 (diff) | |
| download | tuxcmd-modules-244fe311199e1df4230b111a7624ddd54c117428.tar.xz | |
Fix directory size calculation
(exclude directory sizes, e.g. valid for ISO9660)
Diffstat (limited to 'common')
| -rw-r--r-- | common/treepath_vfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/treepath_vfs.c b/common/treepath_vfs.c index 6e6a0a1..9a70f5c 100644 --- a/common/treepath_vfs.c +++ b/common/treepath_vfs.c @@ -75,10 +75,8 @@ u_int64_t internal_get_dir_size(struct VfsFilelistData *data, struct PathTree *t while ((n = filelist_tree_get_item_by_index(tree, idx))) { if (data->break_get_dir_size) break; if (n->data) { -// printf("internal_get_dir_size: found item '%s', size = %lu \n", n->node, n->data->iSize); - Size += n->data->iSize; - if ((n->items) && (n->items->len > 0)) - Size += internal_get_dir_size(data, n); + log("internal_get_dir_size: found item '%s', size = %llu \n", n->node, n->data->iSize); + Size += (n->items && n->items->len > 0) ? internal_get_dir_size(data, n) : n->data->iSize; } idx++; } |
