1 Preliminary patch for a feature wishlist item: [[bugs/pruning_is_too_strict]].
3 diff --git a/IkiWiki.pm b/IkiWiki.pm
4 index 1a00f2d..0119a26 100644
7 @@ -20,6 +20,8 @@ our $VERSION = 1.00;
13 memoize("pagespec_translate");
15 my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE
16 @@ -318,6 +320,22 @@ sub baseurl (;$) { #{{{
20 +sub basefile ($;$) { #{{{
22 + my $base=shift || $config{srcdir};
25 + $base=File::Spec->canonpath($base);
26 + my $ret=File::Spec->canonpath($file);
32 +sub is_prune ($;$) { #{{{
33 + return basefile($_[0], $_[1])=~m/$config{wiki_file_prune_regexp}/;
36 sub abs2rel ($$) { #{{{
37 # Work around very innefficient behavior in File::Spec if abs2rel
38 # is passed two relative paths. It's much faster if paths are
39 diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
40 index f550b67..5d1991d 100644
43 @@ -386,7 +386,7 @@ sub cgi_editpage ($$) { #{{{
44 my ($page)=$form->field('page');
45 $page=titlepage(possibly_foolish_untaint($page));
46 if (! defined $page || ! length $page ||
47 - $page=~/$config{wiki_file_prune_regexp}/ || $page=~/^\//) {
48 + is_prune($page) || $page=~/^\//) {
49 error("bad page name");
52 @@ -476,8 +476,7 @@ sub cgi_editpage ($$) { #{{{
54 if (! defined $from || ! length $from ||
55 $from ne $form->field('from') ||
56 - $from=~/$config{wiki_file_prune_regexp}/ ||
58 + is_prune($from) || $from=~/^\// ||
59 $form->submitted eq "Preview") {
60 @page_locs=$best_loc=$page;
62 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
63 index 48a25be..a083d3f 100644
64 --- a/IkiWiki/Render.pm
65 +++ b/IkiWiki/Render.pm
66 @@ -202,7 +202,7 @@ sub refresh () { #{{{
70 - if (/$config{wiki_file_prune_regexp}/) {
74 elsif (! -d $_ && ! -l $_) {
75 @@ -222,7 +222,7 @@ sub refresh () { #{{{
79 - if (/$config{wiki_file_prune_regexp}/) {
80 + if (is_prune($_, $config{underlaydir})) {
83 elsif (! -d $_ && ! -l $_) {