Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix sf#396, Module docs can not be found more than once.
If a user did 'help PDL::IO::Storable' or some other 2-deep module name,
the search for the proper module file from which to display docs
would change the reported location of the docs database (and the documentation head)
in a initialized once-per-pdl-shell variable.  Subsequent searches would
be looking for PDL/IO/IO/Storable.pm, PDL/IO/IO/IO/Storable.pm, etc,
which couldn't be found.  This was due to how foreach aliases the
loop variable to the input array.  Making an explicit copy removes
the aliasing and keeps the variable unchanged.
  • Loading branch information
d-lamb committed Sep 3, 2015
1 parent b26afaa commit 49771f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/Doc/Perldl.pm
Expand Up @@ -265,7 +265,8 @@ sub finddoc {
# We've got a file name and we have to open it. With the relocatable db, we have to reconstitute the absolute pathname.
my $relfile = $m->[1]{File};
my $absfile = undef;
for my $dbf(@{$PDL::onlinedoc->{Scanned}}) {
my @scnd = @{$PDL::onlinedoc->{Scanned}};
for my $dbf(@scnd){
$dbf =~ s:\/[^\/]*$::; # Trim file name off the end of the database file to get just the directory
$dbf .= "/$relfile";
$absfile = $dbf if( -e $dbf );
Expand Down

0 comments on commit 49771f2

Please sign in to comment.