@@ -72,7 +72,7 @@ use Digest::MD5 qw(md5_base64);
72
72
73
73
# Global constants
74
74
our $title = " LCOV - code coverage report" ;
75
- our $lcov_version = ' LCOV version 1.10 pre (CVS $Revision: 1.67 $)' ;
75
+ our $lcov_version = ' LCOV version 1.10 pre (CVS $Revision: 1.68 $)' ;
76
76
our $lcov_url = " http://ltp.sourceforge.net/coverage/lcov.php" ;
77
77
our $tool_name = basename($0 );
78
78
@@ -799,6 +799,9 @@ sub gen_html()
799
799
$br_found , $br_hit )
800
800
= process_dir($dir_name );
801
801
802
+ # Handle files in root directory gracefully
803
+ $dir_name = " root" if ($dir_name eq " " );
804
+
802
805
# Remove prefix if applicable
803
806
if (!$no_prefix && $dir_prefix )
804
807
{
@@ -953,6 +956,10 @@ sub process_dir($)
953
956
$rel_dir = substr ($rel_dir , 1);
954
957
}
955
958
959
+ # Handle files in root directory gracefully
960
+ $rel_dir = " root" if ($rel_dir eq " " );
961
+ $trunc_dir = " root" if ($trunc_dir eq " " );
962
+
956
963
$base_dir = get_relative_base_path($rel_dir );
957
964
958
965
create_sub_dir($rel_dir );
@@ -2196,6 +2203,9 @@ sub get_prefix($@)
2196
2203
}
2197
2204
}
2198
2205
2206
+ # Check if any prefix remains
2207
+ return undef if (!%prefix );
2208
+
2199
2209
# Calculate sum of lengths for all prefixes
2200
2210
foreach $current (keys (%prefix ))
2201
2211
{
0 commit comments