Skip to content

Commit bd4d9ce

Browse files
committed
Fix: don't count empty subdirectories as files
1 parent bfc6b7f commit bd4d9ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

extract-xiso.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1868,13 +1868,14 @@ int write_dir_start_and_file_positions( dir_node_avl *in_avl, wdsafp_context *io
18681868

18691869

18701870
int calculate_total_files_and_bytes( dir_node_avl *in_avl, void *in_context, int in_depth ) {
1871-
if ( in_avl->subdirectory && in_avl->subdirectory != EMPTY_SUBDIRECTORY ) {
1872-
avl_traverse_depth_first( in_avl->subdirectory, (traversal_callback) calculate_total_files_and_bytes, nil, k_prefix, 0 );
1871+
if (in_avl->subdirectory) {
1872+
if (in_avl->subdirectory != EMPTY_SUBDIRECTORY) {
1873+
avl_traverse_depth_first(in_avl->subdirectory, (traversal_callback)calculate_total_files_and_bytes, nil, k_prefix, 0);
1874+
}
18731875
} else {
18741876
++s_total_files;
18751877
s_total_bytes += in_avl->file_size;
18761878
}
1877-
18781879
return 0;
18791880
}
18801881

0 commit comments

Comments
 (0)