Skip to content

Commit d15cf13

Browse files
committed
Fix: don't count empty subdirectories as files
1 parent 963213c commit d15cf13

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
@@ -1873,13 +1873,14 @@ int write_dir_start_and_file_positions( dir_node_avl *in_avl, wdsafp_context *io
18731873

18741874

18751875
int calculate_total_files_and_bytes( dir_node_avl *in_avl, void *in_context, int in_depth ) {
1876-
if ( in_avl->subdirectory && in_avl->subdirectory != EMPTY_SUBDIRECTORY ) {
1877-
avl_traverse_depth_first( in_avl->subdirectory, (traversal_callback) calculate_total_files_and_bytes, nil, k_prefix, 0 );
1876+
if (in_avl->subdirectory) {
1877+
if (in_avl->subdirectory != EMPTY_SUBDIRECTORY) {
1878+
avl_traverse_depth_first(in_avl->subdirectory, (traversal_callback)calculate_total_files_and_bytes, nil, k_prefix, 0);
1879+
}
18781880
} else {
18791881
++s_total_files;
18801882
s_total_bytes += in_avl->file_size;
18811883
}
1882-
18831884
return 0;
18841885
}
18851886

0 commit comments

Comments
 (0)