summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@cpan.org>2012-03-05 22:31:52 -0500
committerRicardo Signes <rjbs@cpan.org>2012-03-05 22:31:52 -0500
commit27fcd19de24b0ea11d42d2e312f66bae99adc3ca (patch)
tree1c5cdfd7bf6157985875e70dd153facc7105009e
parent1cd16d8ac049ac3ffe94281e35fe9270b854408d (diff)
downloadperl-rjbs/pod-html-fix.tar.gz
Sisyphus's fix for pod2htmlrjbs/pod-html-fix
-rw-r--r--ext/Pod-Html/lib/Pod/Html.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm
index 8fc74a439b..c16b6573e7 100644
--- a/ext/Pod-Html/lib/Pod/Html.pm
+++ b/ext/Pod-Html/lib/Pod/Html.pm
@@ -325,7 +325,16 @@ sub pod2html {
or die "$0: error open $Dircache for writing: $!\n";
print $cache join(":", @Podpath) . "\n$Podroot\n";
+ my $_updirs_only = ($Podroot =~ /\.\./) && !($Podroot =~ /[^\.\\\/]/);
foreach my $key (keys %Pages) {
+ if($_updirs_only) {
+ my $_dirlevel = $Podroot;
+ while($_dirlevel =~ /\.\./) {
+ $_dirlevel =~ s/\.\.//;
+ # Assume $Pages{$key} has '/' separators (html dir separators).
+ $Pages{$key} =~ s/^[\w\s\-]+\///;
+ }
+ }
print $cache "$key $Pages{$key}\n";
}