From ec26a9619358498afb817c759625607d3b40f15d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Aug 2009 19:15:25 -0400 Subject: 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 --- IkiWiki/Plugin/po.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin') 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$/; -- cgit v1.2.3