Skip to content

Commit 6ad26d1

Browse files
committed
Fix: don't count empty subdirectories as files
1 parent f72f2e9 commit 6ad26d1

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

18781878

18791879
int calculate_total_files_and_bytes( dir_node_avl *in_avl, void *in_context, int in_depth ) {
1880-
if ( in_avl->subdirectory && in_avl->subdirectory != EMPTY_SUBDIRECTORY ) {
1881-
avl_traverse_depth_first( in_avl->subdirectory, (traversal_callback) calculate_total_files_and_bytes, nil, k_prefix, 0 );
1880+
if (in_avl->subdirectory) {
1881+
if (in_avl->subdirectory != EMPTY_SUBDIRECTORY) {
1882+
avl_traverse_depth_first(in_avl->subdirectory, (traversal_callback)calculate_total_files_and_bytes, nil, k_prefix, 0);
1883+
}
18821884
} else {
18831885
++s_total_files;
18841886
s_total_bytes += in_avl->file_size;
18851887
}
1886-
18871888
return 0;
18881889
}
18891890

0 commit comments

Comments
 (0)