Skip to content

Commit abd8bed

Browse files
MarcoFalkeoberpar
authored andcommitted
genhtml: Unconditionally include anchor for each named line
This helps with referencing the line in the html when sharing links. Signed-off-by: MarcoFalke <[email protected]>
1 parent 28675dc commit abd8bed

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

bin/genhtml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ sub write_test_table_epilog(*);
234234

235235
sub write_source($$$$$$$);
236236
sub write_source_prolog(*);
237-
sub write_source_line(*$$$$$$);
237+
sub write_source_line(*$$$$$);
238238
sub write_source_epilog(*);
239239

240240
sub write_frameset(*$$$);
@@ -4154,16 +4154,15 @@ sub format_count($$)
41544154

41554155
#
41564156
# write_source_line(filehandle, line_num, source, hit_count, converted,
4157-
# brdata, add_anchor)
4157+
# brdata)
41584158
#
41594159
# Write formatted source code line. Return a line in a format as needed
41604160
# by gen_png()
41614161
#
41624162

4163-
sub write_source_line(*$$$$$$)
4163+
sub write_source_line(*$$$$$)
41644164
{
4165-
my ($handle, $line, $source, $count, $converted, $brdata,
4166-
$add_anchor) = @_;
4165+
my ($handle, $line, $source, $count, $converted, $brdata) = @_;
41674166
my $source_format;
41684167
my $count_format;
41694168
my $result;
@@ -4200,11 +4199,8 @@ sub write_source_line(*$$$$$$)
42004199

42014200
# Write out a line number navigation anchor every $nav_resolution
42024201
# lines if necessary
4203-
if ($add_anchor)
4204-
{
4205-
$anchor_start = "<a name=\"$_[1]\">";
4206-
$anchor_end = "</a>";
4207-
}
4202+
$anchor_start = "<a name=\"$_[1]\">";
4203+
$anchor_end = "</a>";
42084204

42094205

42104206
# *************************************************************
@@ -5126,7 +5122,6 @@ sub write_source($$$$$$$)
51265122
my $funcdata = $_[5];
51275123
my $sumbrcount = $_[6];
51285124
my $datafunc = get_hash_reverse($funcdata);
5129-
my $add_anchor;
51305125
my @file;
51315126

51325127
if ($_[2])
@@ -5177,25 +5172,11 @@ sub write_source($$$$$$$)
51775172
"$line_number\n");
51785173
}
51795174

5180-
$add_anchor = 0;
5181-
if ($frames) {
5182-
if (($line_number - 1) % $nav_resolution == 0) {
5183-
$add_anchor = 1;
5184-
}
5185-
}
5186-
if ($func_coverage) {
5187-
if ($line_number == 1) {
5188-
$add_anchor = 1;
5189-
} elsif (defined($datafunc->{$line_number +
5190-
$func_offset})) {
5191-
$add_anchor = 1;
5192-
}
5193-
}
51945175
push (@result,
51955176
write_source_line(HTML_HANDLE, $line_number,
51965177
$_, $count_data{$line_number},
51975178
$converted->{$line_number},
5198-
$sumbrcount->{$line_number}, $add_anchor));
5179+
$sumbrcount->{$line_number}));
51995180
}
52005181

52015182
close(SOURCE_HANDLE);

0 commit comments

Comments
 (0)