From: Gavin Carr Date: Wed, 12 Sep 2007 12:48:32 +0000 (+0000) Subject: Fix nasty entry-ignoring bug in flavourpathinfo. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=92e394a494a24c61c574eee8fcbaa770bc434f29;p=matthijs%2Fupstream%2Fblosxom-plugins.git Fix nasty entry-ignoring bug in flavourpathinfo. --- diff --git a/gavinc/flavourpathinfo b/gavinc/flavourpathinfo index 6ab1b9c..28ea749 100644 --- a/gavinc/flavourpathinfo +++ b/gavinc/flavourpathinfo @@ -1,7 +1,8 @@ # Blosxom Plugin: flavourpathinfo # Author(s): Gavin Carr -# Version: 0.002000 +# Version: 0.002001 # Documentation: 'perldoc flavourpathinfo' +# Follows: extensionless package flavourpathinfo; @@ -24,12 +25,16 @@ sub debug { sub start { my $path_info = $blosxom::path_info; - debug(1, "original path_info: $path_info"); - return 1 if -e "$blosxom::datadir/$path_info"; # Remove any trailing / $path_info =~ s! /$ !!x; + my $path_file = $blosxom::path_info; + $path_file =~ s/\.\w+$/.$blosxom::file_extension/; + return 1 if -e "$blosxom::datadir/$path_info" || -f "$blosxom::datadir/$path_file"; + + debug(1, "original path_info: $path_info"); + # Check file/flavour variant if ($path_info =~ m! ^ (.*) / ([^/]+) $ !x) { my $flavour = $2; @@ -111,8 +116,11 @@ map to: =head1 USAGE -Should be loaded early as it manipulates $blosxom::path_info -e.g. as 00flavourpathinfo. +If used with the 'extensionless' plugin, it should be loaded +*after* extensionless. + +But should be loaded early as it manipulates $blosxom::path_info +e.g. as 02flavourpathinfo. =head1 SEE ALSO