aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-08-28 19:15:25 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-08-28 19:15:25 -0400
commitec26a9619358498afb817c759625607d3b40f15d (patch)
treef3dcb8d35faee35467a2f4327eaa08d7838d4882
parent2ba54735ce78a80d9577bef068f674559dddf57b (diff)
downloadikiwiki-ec26a9619358498afb817c759625607d3b40f15d.tar
ikiwiki-ec26a9619358498afb817c759625607d3b40f15d.tar.gz
avoid clobbering origsub if checkconfig runs more than once
checkconfig can run more than once in a single ikiwiki run if setup is building wrappers. That clobbered the origsub value for bestlink, leading to infinite recursion
-rw-r--r--IkiWiki/Plugin/po.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 55c1c32c6..cde2ad4e3 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -152,8 +152,10 @@ sub checkconfig () {
$config{po_link_to}='default';
}
unless ($config{po_link_to} eq 'default') {
- $origsubs{'bestlink'}=\&IkiWiki::bestlink;
- inject(name => "IkiWiki::bestlink", call => \&mybestlink);
+ if (! exists $origsubs{'bestlink'}) {
+ $origsubs{'bestlink'}=\&IkiWiki::bestlink;
+ inject(name => "IkiWiki::bestlink", call => \&mybestlink);
+ }
}
push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/;