Skip to content

Commit 2041373

Browse files
committed
Add prefix to saved file names - avoid overwrite when same name is used
in both baseline and current. Signed-off-by: Henry Cox <[email protected]>
1 parent d202cc8 commit 2041373

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

bin/genhtml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6650,11 +6650,18 @@ if ($output_directory && !-d $output_directory) {
66506650

66516651
if ($save && $output_directory)
66526652
{ # save copy of .info and diff files: useful for debugging user cases later
6653-
foreach my $from (@base_filenames, $diff_filename, @info_filenames) {
6654-
next unless defined($from);
6655-
my $to = File::Spec->catfile($output_directory,
6656-
File::Basename::basename($from));
6657-
File::Copy::copy($from, $to) unless -f $to;
6653+
foreach my $d (['baseline_', @base_filenames],
6654+
['', $diff_filename],
6655+
['current_', @info_filenames]
6656+
) {
6657+
my $prefix = shift @$d;
6658+
$prefix = '' unless @base_filenames;
6659+
foreach my $from (@$d) {
6660+
next unless defined($from);
6661+
my $to = File::Spec->catfile($output_directory,
6662+
$prefix . File::Basename::basename($from));
6663+
File::Copy::copy($from, $to) unless -f $to;
6664+
}
66586665
}
66596666
}
66606667

0 commit comments

Comments
 (0)