- my @pages=keys %IkiWiki::pagesources;
- return $#pages+1 if $params{pages} eq "*"; # optimisation
- my $count=0;
- foreach my $page (@pages) {
- $count++ if IkiWiki::globlist_match($page, $params{pages});
- }
- return $count;
-} # }}}
+ my @pages=pagespec_match_list([keys %pagesources], $params{pages}, location => $params{page})
+ if $params{pages} ne "*"; # optimisation;
+ return $#pages+1;
+}