Skip to content

Commit 894cd88

Browse files
wak-googleoberpar
authored andcommitted
genhtml: Fix applying prefix to a prefix filename
Currently, if you have source code that lives in the top-level of your project but you have that top-level set as a prefix, genhtml will not do anything to truncate the prefix for the directory link. Assume genhtml is called with `--prefix /home/wak/project` Example layout: /home/wak/project/lib.cpp /home/wak/project/test/test_lib.cpp This would result in generating an index.html with Directories: /home/wak/project test This is not expected. Looking at the convention for top level directories, we should be calling these directories "root". With the patch applied, the index.html has Directories: root test Signed-off-by: William A. Kennington III <[email protected]>
1 parent a942cc2 commit 894cd88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/genhtml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,6 +5664,10 @@ sub apply_prefix($@)
56645664
{
56655665
foreach my $prefix (@dir_prefix)
56665666
{
5667+
if ($prefix eq $filename)
5668+
{
5669+
return "root";
5670+
}
56675671
if ($prefix ne "" && $filename =~ /^\Q$prefix\E\/(.*)$/)
56685672
{
56695673
return substr($filename, length($prefix) + 1);

0 commit comments

Comments
 (0)