use one parameter form of file_pruned here too
authorJoey Hess <joey@kitenet.net>
Tue, 20 Apr 2010 17:54:24 +0000 (13:54 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 20 Apr 2010 17:54:24 +0000 (13:54 -0400)
In File::Find, $_ is relative to the current directory, so that is ok.
Also, the directory name doesn't need to be stripped from $_.

IkiWiki/Plugin/comments.pm

index 1c219b6c6adeb492a361e1459567b6a0614a4e44..32e4d09377001a3b769429a7b4561c26730ab091 100644 (file)
@@ -645,7 +645,7 @@ sub comments_pending () {
                no_chdir => 1,
                wanted => sub {
                        $_=decode_utf8($_);
-                       if (IkiWiki::file_pruned($_, $dir)) {
+                       if (IkiWiki::file_pruned($_)) {
                                $File::Find::prune=1;
                        }
                        elsif (! -l $_ && ! -d _) {
@@ -653,7 +653,6 @@ sub comments_pending () {
                                my ($f)=/$config{wiki_file_regexp}/; # untaint
                                if (defined $f && $f =~ /\Q._comment\E$/) {
                                        my $ctime=(stat($f))[10];
-                                       $f=~s/^\Q$dir\E\/?//;
                                         push @ret, [$f, $ctime];
                                }
                        }