Skip to content

Commit fe17f7a

Browse files
committed
Fix: don't count empty subdirectories as files
1 parent 0c480c7 commit fe17f7a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

extract-xiso.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,13 +1875,14 @@ int write_dir_start_and_file_positions( dir_node_avl *in_avl, wdsafp_context *io
18751875

18761876

18771877
int calculate_total_files_and_bytes( dir_node_avl *in_avl, void *in_context, int in_depth ) {
1878-
if ( in_avl->subdirectory && in_avl->subdirectory != EMPTY_SUBDIRECTORY ) {
1879-
avl_traverse_depth_first( in_avl->subdirectory, (traversal_callback) calculate_total_files_and_bytes, nil, k_prefix, 0 );
1878+
if (in_avl->subdirectory) {
1879+
if (in_avl->subdirectory != EMPTY_SUBDIRECTORY) {
1880+
avl_traverse_depth_first(in_avl->subdirectory, (traversal_callback)calculate_total_files_and_bytes, nil, k_prefix, 0);
1881+
}
18801882
} else {
18811883
++s_total_files;
18821884
s_total_bytes += in_avl->file_size;
18831885
}
1884-
18851886
return 0;
18861887
}
18871888

0 commit comments

Comments
 (0)