From bd4d9ce48a915675d0643cbdacf232829d37fbbd Mon Sep 17 00:00:00 2001 From: rapperskull Date: Mon, 6 Mar 2023 00:24:37 +0100 Subject: [PATCH] Fix: don't count empty subdirectories as files --- extract-xiso.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extract-xiso.c b/extract-xiso.c index 2cc6b7f..d0aaf98 100644 --- a/extract-xiso.c +++ b/extract-xiso.c @@ -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; }