summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/aggregate.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/aggregate.pm')
-rw-r--r--IkiWiki/Plugin/aggregate.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 964ef4b4b..d11283f0a 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -310,6 +310,20 @@ sub add_page (@) { #{{{
-e pagefile($page.$c)) {
$c++
}
+
+ # Make sure that the file name isn't too long.
+ # NB: This doesn't check for path length limits.
+ eval q{use POSIX};
+ my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX);
+ if (defined $max && length(htmlpage($page)) >= $max) {
+ $c="";
+ $page="item";
+ while (exists $IkiWiki::pagecase{lc $page.$c} ||
+ -e pagefile($page.$c)) {
+ $c++
+ }
+ }
+
$guid->{page}=$page;
debug(sprintf(gettext("creating new page %s"), $page));
}