Commits

Diab Jerius  committed f228e09

output information on matching profile

  • Participants
  • Parent commits 19d7d73

Comments (0)

Files changed (1)

File src/wikiup.pl.in

       # matched! use the newly parsed topic path if necessary
       if ( $match )
       {
+	  info "Matched profile: ", $config->profile, "\n";
 	  $topic_path = $rpath unless defined $topic_path;
       }
 
 	    # reject unless the entire profile URI is matched
 	    next unless $nmatch == @psegs;
 
-	    push @matches, [ $nmatch, $profile ]
+	    push @matches, [ $nmatch, $name, $profile ]
 	}
 
 	if ( @matches )
 	{
 	    # choose the profile with the most matching segments
 	    ( $match ) = sort { $b->[0] <=> $a->[0] } @matches;
-	    $self->{default} = $match->[1];
+	    ( $self->{profile}, $self->{default} ) = @{$match}[1,2];
 
 	    # create a path from the residual non-matched path segments
 	    $rpath = join('/', @segs[$match->[0]..@segs-1]);
 	return ( defined $match, $rpath );
     }
 
+    sub profile { $_[0]->{profile} }
+
     sub set_profile {
 
 	my ( $self, $profile ) = @_;