From: Joey Hess Date: Fri, 28 Aug 2009 23:15:25 +0000 (-0400) Subject: avoid clobbering origsub if checkconfig runs more than once X-Git-Tag: 3.1415926~11 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/ec26a9619358498afb817c759625607d3b40f15d?hp=-c 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 --- ec26a9619358498afb817c759625607d3b40f15d 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$/;