Skip to content

Commit

Permalink
Fix: don't count empty subdirectories as files
Browse files Browse the repository at this point in the history
  • Loading branch information
rapperskull committed Mar 5, 2023
1 parent bfc6b7f commit bd4d9ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extract-xiso.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,13 +1868,14 @@ int write_dir_start_and_file_positions( dir_node_avl *in_avl, wdsafp_context *io


int calculate_total_files_and_bytes( dir_node_avl *in_avl, void *in_context, int in_depth ) {
if ( in_avl->subdirectory && in_avl->subdirectory != EMPTY_SUBDIRECTORY ) {
avl_traverse_depth_first( in_avl->subdirectory, (traversal_callback) calculate_total_files_and_bytes, nil, k_prefix, 0 );
if (in_avl->subdirectory) {
if (in_avl->subdirectory != EMPTY_SUBDIRECTORY) {
avl_traverse_depth_first(in_avl->subdirectory, (traversal_callback)calculate_total_files_and_bytes, nil, k_prefix, 0);
}
} else {
++s_total_files;
s_total_bytes += in_avl->file_size;
}

return 0;
}

Expand Down

0 comments on commit bd4d9ce

Please sign in to comment.