Factor out readability check in default entries().
authorGavin Carr <gavin@openfusion.com.au>
Fri, 18 Jun 2010 20:22:06 +0000 (21:22 +0100)
committerGavin Carr <gavin@openfusion.com.au>
Fri, 18 Jun 2010 20:22:06 +0000 (21:22 +0100)
blosxom.cgi

index 11143b1..420a1b6 100755 (executable)
@@ -555,6 +555,7 @@ $entries = sub {
         sub {
             my $curr_depth = $File::Find::dir =~ tr[/][];
             return if $depth and $curr_depth > $depth;
+            return if !-r $File::Find::name;
 
             if (
 
@@ -563,7 +564,7 @@ $entries = sub {
                 =~ m!^$datadir/(?:(.*)/)?(.+)\.$file_extension$!
 
                 # not an index, .file, and is readable
-                and $2 ne 'index' and $2 !~ /^\./ and ( -r $File::Find::name )
+                and $2 ne 'index' and $2 !~ /^\./
                 )
             {
 
@@ -592,7 +593,7 @@ $entries = sub {
             }
 
             # not an entries match
-            elsif ( !-d $File::Find::name and -r $File::Find::name ) {
+            elsif ( !-d $File::Find::name ) {
                 $others{$File::Find::name} = stat($File::Find::name)->mtime;
             }
         },