From: Joey Hess Date: Thu, 23 Apr 2009 20:35:56 +0000 (-0400) Subject: Revert "pagespec_match_list * optimisation" X-Git-Tag: 3.11~38 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/85ae48b21eed71eeace8cd093ce92b7399cba861 Revert "pagespec_match_list * optimisation" This reverts commit 2f96c49bd1826ecb213ae025ad456a714aa04863. I forgot about internal pages. We don't want * matching them! I left the optimisation in pagecount, where it used to live. Internal pages probably don't matter when they're just being counted. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index e8c0c7abc..e260fffea 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1837,8 +1837,6 @@ sub pagespec_match_list ($$;@) { my $spec=shift; my @params=@_; - return @$pages if $spec eq '*'; # optimisation - my $sub=pagespec_translate($spec); error "syntax error in pagespec \"$spec\"" if $@ || ! defined $sub; diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index a561e58e5..f8881a04b 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -26,7 +26,9 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my @pages=pagespec_match_list([keys %pagesources], $params{pages}, location => $params{page}); + my @pages=keys %pagesources; + @pages=pagespec_match_list(\@pages, $params{pages}, location => $params{page}) + if $params{pages} ne "*"; # optimisation; return $#pages+1; }